<!-- 第9套:频谱分析仪标准装置 --> <!-- 检定数据管理详情模板 --> <script lang="ts" setup name="MeasureDataTemplateDetail"> import { ref } from 'vue' import { ElLoading, ElMessage } from 'element-plus' import dayjs from 'dayjs' import changeRecord from '../changeRecord.vue' import selectStandard from '../../dialog/selectStandardDialog.vue' import TemplateFormAndTable from '../templateFormAndTable.vue' import { useSolveFormData } from '../useSolveFormData' import type { IDetailMeasureList } from './ninth-interface' import categoryNameDict from '/public/config/categoryNameDict.json' import templateTable from './templateTable.vue' import useUserStore from '@/store/modules/user' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' import { calculateHandle, getInfo } from '@/api/business/taskMeasure/measureData' import { getInfo as getItemInfo } from '@/api/business/measure/item' import { useCheckList } from '@/commonMethods/useCheckList' import { calc } from '@/utils/useCalc' import templateTable1 from '@/views/business/measure/item/components/second/templateTable.vue' import { clearSymbol, removeLetters } from '@/utils/String' const props = defineProps({ infoId: String, // id dataNo: String, // 检定数据编号 }) const emits = defineEmits(['giveInfoId', 'changeMeterIdentify']) const user = useUserStore() // 用户信息 const $router = useRouter() // 关闭页面使用 const $route = useRoute() // 路由参数 const ruleFormRef = ref() // 表单ref const templateFormAndTableRef = ref() // 表单和被检设备、测量设备表格公共组件ref const mesureItemData = ref([]) const itemFormData = ref({ // 有关于检定项的数据 itemId: '', // 检定项id itemCategoryName: '', // 设备检定项分类名称 itemCategoryId: '', // 设备检定项分类名称id belongStandardEquipment: '', // 标准装置code belongStandardEquipmentName: '', // 标准装置名称 appearanceRemark: '正常', appearanceFunctionCheck: 1 as any, // 外观(1/0) }) // -------------------------------------------路由参数------------------------------------------ const pageType = ref('add') // 页面类型: add, edit, detail const infoId = ref('') // 列表id if ($route.params && $route.params.type) { pageType.value = $route.params.type as string if ($route.params.id) { infoId.value = $route.params.id as string } } // ------------------------------------------标签---------------------------------------------------------- const radioMenus = ref([ // 标签内容 { name: '检定数据', value: 'measure-data' }, { name: '历史修改记录', value: 'change-record' }, ]) const current = ref('measure-data') // 选择的tab 默认基本信息 // ---------------------------------------检定项数据表格---------------------------------------------------- const frequencyList = ref<IDetailMeasureList[]>([]) // 频率显示 const sweepWidthList = ref<IDetailMeasureList[]>([]) // 扫频宽度 const intermediateFrequencyBandwidthList = ref<IDetailMeasureList[]>([]) // 中频带宽 const transitionDeviationList = ref<IDetailMeasureList[]>([]) // 中频带宽转换偏差 const referenceElectricalLevelList = ref<IDetailMeasureList[]>([]) // 参考电平 const verticalGraduatedList = ref<IDetailMeasureList[]>([]) // 垂直刻度(显示位置从上到下) const inputFrequencyResponseList = ref<IDetailMeasureList[]>([]) // 输入频响 const averageNoiseLevelList = ref<IDetailMeasureList[]>([]) // 平均噪声电平 const harmonicDistortionList = ref<IDetailMeasureList[]>([]) // 谐波失真 const inputAttenuatorList = ref<IDetailMeasureList[]>([]) // 输入衰减 const gainCompressionPointList = ref<IDetailMeasureList[]>([]) // 1dB增益压缩点 const calibratingSignalList = ref<IDetailMeasureList[]>([]) // 校准信号 const listDict = ref<{ [key: string]: IDetailMeasureList[] }>({}) const setListDict = () => { listDict.value = { '1-频率显示': frequencyList.value, // 频率显示 '2-扫频宽度': sweepWidthList.value, // 扫频宽度 '3-中频带宽': intermediateFrequencyBandwidthList.value, // 中频带宽 '4-中频带宽转换偏差': transitionDeviationList.value, // 中频带宽转换偏差 '5-参考电平': referenceElectricalLevelList.value, // 参考电平 '6-垂直刻度(显示位置从上到下)': verticalGraduatedList.value, // 垂直刻度(显示位置从上到下) '7-输入频响': inputFrequencyResponseList.value, // 输入频响 '8-平均噪声电平': averageNoiseLevelList.value, // 平均噪声电平 '9-谐波失真': harmonicDistortionList.value, // 谐波失真 '10-输入衰减': inputAttenuatorList.value, // 输入衰减 '11-1dB增益压缩点': gainCompressionPointList.value, // 1dB增益压缩点 '12-校准信号': calibratingSignalList.value, // 校准信号 } } const columns_frequency = ref<TableColumn[]>([ // 频率显示 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: false, type: 'text' }, { text: '分辨力带宽', value: 'resolutionBandwidth', align: 'center', required: false, type: 'text' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: false, type: 'text' }, { text: '测量值1', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '测量值2', value: 'twoValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '测量值3', value: 'threeValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text' }, { text: '均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 频率显示展示单位的列 const frequency_unit = ref(['标称值', '扫频宽度', '分辨力带宽', '水平分辨率', '测量值1', '测量值2', '测量值3']) // 频率显示展示单位列对应的字段字典 const frequency_dict: { [key: string]: string } = { 标称值: 'unit', 扫频宽度: 'sweepWidthUnit', 分辨力带宽: 'resolutionBandwidthUnit', 水平分辨率: 'horizontalResolutionUnit', 测量值1: 'unit', 测量值2: 'unit', 测量值3: 'unit', 指标下限: 'unit', 均值: 'unit', 指标上限: 'unit', } const columns_sweep_width = ref<TableColumn[]>([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: false, type: 'text' }, { text: 'fl1', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fr1', value: 'twoValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fl2', value: 'threeValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fr2', value: 'fourValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fl3', value: 'fiveValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fr3', value: 'sixValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text', width: '150' }, { text: '均值', value: 'averageValue', align: 'center', required: false, type: 'text', width: '150' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text', width: '150' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text', width: '150' }, ]) // 扫频宽度展示单位的列 const sweep_width_unit = ref(['标称值', '水平分辨率']) // 扫频宽度展示单位列对应的字段字典 const sweep_width_dict: { [key: string]: string } = { 标称值: 'unit', 指标下限: 'unit', 指标上限: 'unit', 水平分辨率: 'horizontalResolutionUnit', } const columns_intermediate_frequency_bandwidth = ref<TableColumn[]>([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: 'fl1', value: 'oneValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fr1', value: 'twoValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: '△f1', value: 'eightValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fl2', value: 'threeValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fr2', value: 'fourValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: '△f2', value: 'nineValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fl3', value: 'fiveValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: 'fr3', value: 'sixValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: '△f3', value: 'tenValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number', width: '150' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text', width: '150' }, { text: '均值', value: 'averageValue', align: 'center', required: false, type: 'text', width: '150' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text', width: '150' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text', width: '150' }, ]) // 中频带宽展示单位的列 const intermediate_frequency_bandwidth_unit = ref(['标称值', 'fl1', 'fr1', 'fl2', 'fr2', 'fl3', 'fr3', '△f3', '△f1', '△f2']) // 中频带宽展示单位列对应的字段字典 const intermediate_frequency_bandwidth_dict: { [key: string]: string } = { '标称值': 'unit', 'fl1': 'unit', 'fr1': 'unit', 'fl2': 'unit', 'fr2': 'unit', 'fl3': 'unit', 'fr3': 'unit', '△f3': 'unit', '△f1': 'unit', '△f2': 'unit', '指标下限': 'unit', '指标上限': 'unit', } const columns_transition_deviation = ref<TableColumn[]>([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '中频带宽', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: '测量值', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '指标下限', value: 'lowerConvertDeviation', align: 'center', required: false, type: 'text' }, { text: '转换偏差', value: 'convertDeviation', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperConvertDeviation', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 中频带宽转换偏差展示单位的列 const transition_deviation_unit = ref(['中频带宽']) // 中频带宽转换偏差展示单位列对应的字段字典 const transition_deviation_dict: { [key: string]: string } = { 中频带宽: 'unit', 指标下限: 'technicalIndexUnit', 指标上限: 'technicalIndexUnit', } const columns_reference_electrical_level = ref<TableColumn[]>([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text' }, { text: '测量值', value: 'oneValue', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 参考电平展示单位的列 const reference_electrical_level_unit = ref(['标称值']) // 参考电平展示单位列对应的字段字典 const reference_electrical_level_dict: { [key: string]: string } = { 标称值: 'unit', 指标下限: 'unit', 指标上限: 'unit', 测量值: 'unit', } const columns_vertical_graduated = ref<TableColumn[]>([ // 垂直刻度(显示位置从上到下) { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: false, type: 'text' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text' }, { text: '测量值', value: 'oneValue', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 垂直刻度(显示位置从上到下)展示单位的列 const vertical_graduated_unit = ref(['标称值']) // 垂直刻度(显示位置从上到下)展示单位列对应的字段字典 const vertical_graduated_dict: { [key: string]: string } = { 标称值: 'unit', 指标下限: 'unit', 指标上限: 'unit', 测量值: 'unit', } const columns_input_frequency_response = ref<TableColumn[]>([ // 输入频响 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '频率', value: 'frequency', align: 'center', required: false, type: 'text' }, { text: '测量值1', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '测量值2', value: 'twoValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '测量值3', value: 'threeValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text' }, { text: '输入频响', value: 'inputFrequency', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 输入频响展示单位的列 const input_frequency_response_unit = ref(['频率']) // 输入频响展示单位列对应的字段字典 const input_frequency_response_dict: { [key: string]: string } = { 频率: 'frequencyUnit', // 测量值1: 'technicalIndexUnit', // 测量值2: 'technicalIndexUnit', // 测量值3: 'technicalIndexUnit', } const columns_average_noise_level = ref<TableColumn[]>([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '前置放大器设置', value: 'preAmplifier', align: 'center', required: false, type: 'text' }, { text: '起始频率', value: 'startFrequency', align: 'center', required: false, type: 'text' }, { text: '终止频率', value: 'endFrequency', align: 'center', required: false, type: 'text' }, { text: '测量值', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '修正后结果', value: 'revisedResult', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 平均噪声电平展示单位的列 const average_noise_level_unit = ref(['起始频率', '终止频率', '指标上限']) // 平均噪声电平展示单位列对应的字段字典 const average_noise_level_dict: { [key: string]: string } = { 起始频率: 'startFrequencyUnit', 终止频率: 'endFrequencyUnit', } const columns_harmonic_distortion = ref<TableColumn[]>([ // 谐波失真 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '频率', value: 'frequency', align: 'center', required: false, type: 'text' }, { text: '基波幅度', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '二次谐波幅度', value: 'twoValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '二次谐波失真', value: 'threeValue', align: 'center', required: false, type: 'text' }, { text: '三次谐波幅度', value: 'fourValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '三次谐波失真', value: 'fiveValue', align: 'center', required: false, type: 'text' }, { text: '四次谐波幅度', value: 'sixValue', align: 'center', required: false, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '四次谐波失真', value: 'sevenValue', align: 'center', required: false, type: 'text' }, { text: '二次谐波失真指标上限', value: 'upperIndexTwice', align: 'center', required: false, type: 'text' }, { text: '三次谐波失真指标上限', value: 'upperIndexThrice', align: 'center', required: false, type: '' }, { text: '四次谐波失真指标上限', value: 'upperIndexQuartic', align: 'center', required: false, type: '' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 谐波失真展示单位的列 const harmonic_distortion_unit = ref(['频率']) // 谐波失真展示单位列对应的字段字典 const harmonic_distortion_dict: { [key: string]: string } = { 频率: 'frequencyUnit', } const columns_input_attenuator = ref<TableColumn[]>([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: false, type: 'text' }, { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: false, type: 'text' }, { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: false, type: 'text' }, { text: '测量值', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text' }, { text: '输入衰减器转换影响', value: 'inputAttenuatorConversionEffect', align: 'center', required: false, type: 'text' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 输入衰减真展示单位的列 const input_attenuator_unit = ref(['标准衰减器衰减量', '输入衰减器', '频谱仪参考电平']) // 输入衰减展示单位列对应的字段字典 const input_attenuator_dict: { [key: string]: string } = { 标准衰减器衰减量: 'standardAttenuatorAttenuationUnit', 输入衰减器: 'inputAttenuatorUnit', 频谱仪参考电平: 'spectrumLevelUnit', // 指标上限: 'technicalIndexUnit', // 指标下限: 'technicalIndexUnit', } const columns_gain_compression_point = ref<TableColumn[]>([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '输入衰减', value: 'inputAttenuator', align: 'center', required: false, type: 'text' }, { text: '参考电平', value: 'spectrumLevel', align: 'center', required: false, type: 'text' }, { text: '测量值', value: 'oneValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '增益压缩', value: 'gainCompression', align: 'center', required: false, type: 'text' }, { text: '技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 1dB增益压缩点展示单位的列 const gain_compression_point_unit = ref(['参考电平', '输入衰减']) // 1dB增益压缩点展示单位列对应的字段字典 const gain_compression_point_dict: { [key: string]: string } = { 参考电平: 'spectrumLevelUnit', 输入衰减: 'inputAttenuatorUnit', } const columns_calibrating_signal = ref<TableColumn[]>([ // 校准信号 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '类型', value: 'typeValue', align: 'center', required: false, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' }, { text: '测量值1', value: 'oneValue', align: 'center', required: true, type: '' }, { text: '测量值2', value: 'twoValue', align: 'center', required: true, type: '' }, { text: '测量值3', value: 'threeValue', align: 'center', required: true, type: '' }, { text: '指标下限', value: 'lowerIndex', align: 'center', required: false, type: 'text' }, { text: '测量结果', value: 'measureResult', align: 'center', required: false, type: '' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'text' }, { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' }, ]) // 校准信号展示单位的列 const calibrating_signal_unit = ref(['参考电平', '输入衰减', '标称值']) // 校准信号展示单位列对应的字段字典 const calibrating_signal_dict: { [key: string]: string } = { 参考电平: 'spectrumLevelUnit', 输入衰减: 'inputAttenuatorUnit', 测量结果: 'measureResultUnit', 标称值: 'unit', // 指标下限: 'unit', // 指标上限: 'unit', // 标称值: 'unit', } const columnsDict = ref<{ [key: string]: any[] | TableColumn[] }>({ '1-频率显示': columns_frequency.value, // 频率显示 '2-扫频宽度': columns_sweep_width.value, // 扫频宽度 '3-中频带宽': columns_intermediate_frequency_bandwidth.value, // 中频带宽 '4-中频带宽转换偏差': columns_transition_deviation.value, // 中频带宽转换偏差 '5-参考电平': columns_reference_electrical_level.value, // 参考电平 '6-垂直刻度(显示位置从上到下)': columns_vertical_graduated.value, // 垂直刻度(显示位置从上到下) '7-输入频响': columns_input_frequency_response.value, // 输入频响 '8-平均噪声电平': columns_average_noise_level.value, // 平均噪声电平 '9-谐波失真': columns_harmonic_distortion.value, // 谐波失真 '10-输入衰减': columns_input_attenuator.value, // 输入衰减 '11-1dB增益压缩点': columns_gain_compression_point.value, // 1dB增益压缩点 '12-校准信号': columns_calibrating_signal.value, // 校准信号 }) watch(() => pageType.value, (newValue) => { if (newValue) { if (newValue === 'detail') { for (const i in columnsDict.value) { columnsDict.value[i].forEach((item: TableColumn | any) => { item.type = 'text' }) } } } }) // -------------------------------------------获取详情信息-------------------------------------------------- // 获取页面详情信息 const fetchInfo = () => { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) getInfo({ id: infoId.value, belongStandardEquipment: itemFormData.value.belongStandardEquipment, // 我的任务跳转过来如果已经配置过检定项了,到编辑页面,且用一下三个字段替代传id请求详情 itemId: $route.query.itemId, // 检定项id orderId: $route.query.orderId, // 任务单id sampleId: $route.query.sampleId, // 被检设备id }).then(async (res) => { // 有关于检定项的数据 itemFormData.value.itemId = res.data.itemId // 检定项id itemFormData.value.itemCategoryName = res.data.itemCategoryName // 设备检定项分类名称 itemFormData.value.itemCategoryId = res.data.itemCategoryId ? res.data.itemCategoryId : itemFormData.value.itemCategoryId // 设备检定项分类名称id itemFormData.value.appearanceFunctionCheck = Number(res.data.appearanceFunctionCheck)// 外观及功能检查 itemFormData.value.appearanceRemark = res.data.appearanceRemark // 外观及功能检查 const params = { id: itemFormData.value.itemId, itemCategoryName: itemFormData.value.itemCategoryName, // 检定项分类名字 belongStandardEquipment: itemFormData.value.belongStandardEquipment, // 检校标准装置字典code } // const response = await getItemInfo(params) // mesureItemData.value = JSON.parse(JSON.stringify(response.data.measureItemDataSpectrumAnalyzerList)) initInputData(res.data.measureDataSpectrumAnalyzerList) // =======================================表单公共组件数据处理======================================================= useSolveFormData(res, templateFormAndTableRef.value) // ==================================检定数据======================================================================== infoId.value = res.data.id emits('giveInfoId', infoId.value) loading.close() }) } // 初始化数据 function initAllData() { for (const i in listDict.value) { listDict.value[i] = [] } frequencyList.value = [] sweepWidthList.value = [] intermediateFrequencyBandwidthList.value = [] transitionDeviationList.value = [] referenceElectricalLevelList.value = [] verticalGraduatedList.value = [] inputFrequencyResponseList.value = [] averageNoiseLevelList.value = [] harmonicDistortionList.value = [] inputAttenuatorList.value = [] gainCompressionPointList.value = [] calibratingSignalList.value = [] } // 初始化输入数据 function initInputData(data: any) { initAllData() // 处理referencePoint字段 const handlerReferencePoint = (row: any) => { if(String(row.referencePoint) === '1') { return 'contain' } else { if(row.conclusion === '参考点') { return 'conclusion' } else { return 'none' } } } data.forEach((item: any, index: number) => { switch (item.dataType) { case '1': // 频率显示 frequencyList.value.push({ ...item, params: '频率显示', oneValue: item.oneValue || '', twoValue: item.twoValue || '', threeValue: item.threeValue || '', lowerIndex: item.lowerIndex || '/', averageValue: item.averageValue || '/', upperIndex: item.upperIndex || '/', conclusion: item.conclusion || '/' }) break case '2': // 扫频宽度 sweepWidthList.value.push({ ...item, params: '扫频宽度', oneValue: removeLetters(item.oneValue || ' ') || '', twoValue: removeLetters(item.twoValue || '') || '', threeValue: removeLetters(item.threeValue || '') || '', fourValue: removeLetters(item.fourValue || '') || '', fiveValue: removeLetters(item.fiveValue || '') || '', sixValue: removeLetters(item.sixValue || '') || '', lowerIndex: item.lowerIndex || '/', averageValue: item.averageValue || '/', upperIndex: item.upperIndex || '/', conclusion: item.conclusion || '/' }) break case '3': // 中频带宽 intermediateFrequencyBandwidthList.value.push({ ...item, params: '中频带宽', tenValue: clearSymbol(item.tenValue || '') || '', nineValue: clearSymbol(item.nineValue || '') || '', eightValue: clearSymbol(item.eightValue || '') || '', oneValue: clearSymbol(item.oneValue || '') || '', twoValue: clearSymbol(item.twoValue || '') || '', threeValue: clearSymbol(item.threeValue || '') || '', fourValue: clearSymbol(item.fourValue || '') || '', fiveValue: clearSymbol(item.fiveValue || '') || '', sixValue: clearSymbol(item.sixValue || '') || '', technicalIndex: clearSymbol(item.technicalIndex || '') || '/', lowerIndex: clearSymbol(item.lowerIndex || '') || '/', averageValue: item.averageValue || '/', upperIndex: clearSymbol(item.upperIndex || '') || '/', conclusion: item.conclusion || '/' }) break case '4': // 中频带宽转换偏差 transitionDeviationList.value.push({ ...item, params: '中频带宽转换偏差', // conclusion: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : item.conclusion || '', conclusion: handlerReferencePoint(item) === 'none' ? item.conclusion || '' : '参考点', // upperConvertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperConvertDeviation || clearSymbol(item.technicalIndex) || '/'), upperConvertDeviation: handlerReferencePoint(item) === 'none' ? (item.upperConvertDeviation || clearSymbol(item.technicalIndex) || '/') : '参考点', // convertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '/' : (item.convertDeviation === '/' ? '' : item.convertDeviation), convertDeviation: handlerReferencePoint(item) === 'none' ? (item.convertDeviation === '/' ? '' : item.convertDeviation) : '', // lowerConvertDeviation: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerConvertDeviation || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), lowerConvertDeviation: handlerReferencePoint(item) === 'none' ? (item.lowerConvertDeviation || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') : '参考点', oneValue: removeLetters(item.oneValue || '') || '' }) break case '5': // 参考电平 referenceElectricalLevelList.value.push({ ...item, params: '参考电平', signalSourceAmplitude: Number(item.amplitude) || Number(item.signalSourceAmplitude) || '', standardAttenuatorAttenuation: item.standardAttenuatorAttenuation || '/', // upperIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), upperIndex: handlerReferencePoint(item) === 'none' ? (item.upperIndex || clearSymbol(item.technicalIndex) || '/') : '参考点' , // lowerIndex: Number(mesureItemData.value[index].referencePoint) === 1 ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), lowerIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), conclusion: handlerReferencePoint(item) !== 'none' ? '参考点' : item.conclusion || '/', oneValue: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.oneValue || '/') }) break case '6': // 垂直刻度 verticalGraduatedList.value.push({ ...item, params: '垂直刻度(显示位置从上到下)', conclusion: item.verticalScale === '起始幅度' ? '起点' : item.conclusion || '/', standardAttenuatorAttenuation: item.standardAttenuatorAttenuation || '', signalSourceAmplitude: item.signalSourceAmplitude || '', upperIndex: item.verticalScale === '起始幅度' ? '起点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), lowerIndex: item.verticalScale === '起始幅度' ? '起点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/'), oneValue: item.verticalScale === '起始幅度' ? '起点' : (item.oneValue || '/') }) break case '7': console.log(item, '1111') // 输入频响 inputFrequencyResponseList.value.push({ ...item, params: '输入频响', oneValue: item.oneValue || '', twoValue: item.twoValue || '', threeValue: item.threeValue || '', conclusion: handlerReferencePoint(item) !== 'none' ? '参考点' : item.conclusion || '/', upperIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), lowerIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') }) break case '8': // 平均噪声电平 averageNoiseLevelList.value.push({ ...item, params: '平均噪声电平', oneValue: removeLetters(item.oneValue || '') || '', upperIndex: clearSymbol(item.upperIndex) ? clearSymbol(item.upperIndex) : '/' }) break case '9': // 谐波失真 harmonicDistortionList.value.push({ ...item, params: '谐波失真', oneValue: item.oneValue || '', twoValue: item.twoValue || '', fourValue: item.fourValue || '', sixValue: item.sixValue || '' }) break case '10': // 输入衰减 inputAttenuatorList.value.push({ ...item, params: '输入衰减', oneValue: item.oneValue || '', // inputAttenuator: handlerReferencePoint(item) !== 'none' ? '参考点' : item.inputAttenuator || '', conclusion: handlerReferencePoint(item) !== 'none' ? '参考点' : item.conclusion || '/', upperIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.upperIndex || clearSymbol(item.technicalIndex) || '/'), lowerIndex: handlerReferencePoint(item) !== 'none' ? '参考点' : (item.lowerIndex || `${item.technicalIndex === '/' ? '' : '-'}${clearSymbol(item.technicalIndex)}` || '/') }) break case '11': // 1dB增益压缩点 gainCompressionPointList.value.push({ ...item, params: '1dB增益压缩点', oneValue: item.oneValue || '', technicalIndex: clearSymbol(item.technicalIndex) ? `${(item.technicalIndex)}` : '/' }) break case '12': // 校准信号 console.log(item, 'item') calibratingSignalList.value.push({ ...item, params: '校准信号', oneValue: item.typeValue === '频率' ? '/' : clearSymbol(item.oneValue) || '', twoValue: item.typeValue === '频率' ? '/' : clearSymbol(item.twoValue) || '', threeValue: item.typeValue === '频率' ? '/' : clearSymbol(item.threeValue) || '', measureResult: item.measureResult || '/' }) calibratingSignalList.value = calibratingSignalList.value.map((item: any) => ({ ...item, typeValue: item.typeValue || (item.oneValue === '/' ? '频率' : '幅度'), upperIndex: clearSymbol(item.technicalIndex) ? `+${clearSymbol(item.technicalIndex)}` : '/', lowerIndex: clearSymbol(item.technicalIndex) ? `-${clearSymbol(item.technicalIndex)}` : '/', })) break } }) setListDict() } /** * 新增的时候获取检定项输入数据(获取检定项分类详情) * @param itemId 检定项id * @param itemCategoryName 检定项分类名字 * @param belongStandardEquipment 检校标准装置字典 */ const fetchItemInfo = (itemId: string, itemCategoryName: string, belongStandardEquipment = '') => { const params = { id: itemId, itemCategoryName, // 检定项分类名字 belongStandardEquipment, // 检校标准装置字典code } getItemInfo(params).then((res) => { itemFormData.value.appearanceFunctionCheck = res.data.appearanceFunctionCheck // 外观及功能检查 1有外观,2没有外观 // mesureItemData.value = JSON.parse(JSON.stringify(res.data.measureItemDataSpectrumAnalyzerList)) initInputData(res.data.measureItemDataSpectrumAnalyzerList) // console.log(res.data.measureItemDataSpectrumAnalyzerList, 'res.data.measureItemDataSpectrumAnalyzerList') }) } // ----------------------------------------点击保存时校验--------------------------------------- // 校验 const checkout = () => { } function checkList(list: IDetailMeasureList[], columns: TableColumn[] | any[], title: string) { return useCheckList(list, columns, title) } // -----------------------------------------生成结果处理---------------------------------------- // 点击计算结果 // 计算 const calculateFun = async (list: IDetailMeasureList[]) => { let result = [] as any[] const params = { belongStandardEquipment: itemFormData.value.belongStandardEquipment, // 检校标准装置 itemCategoryName: itemFormData.value.itemCategoryName, // 检定项分类名称 measureDataSpectrumAnalyzerList: list, } const res = await calculateHandle(params) result = res.data return result } // 中频带宽 验证 const checkIntermediateFrequencyBandwidthList = (list: any[]) => { let result = true for (let i = 0; i < list.length; i++) { if (!String(list[i].oneValue) && !String(list[i].twoValue) && !String(list[i].eightValue)) { result = false ElMessage.warning(`中频带宽第${i + 1}行fl1,fr1,△f1不能全为空`) break } if (!String(list[i].eightValue) && (!String(list[i].oneValue) || !String(list[i].twoValue))) { result = false ElMessage.warning(`中频带宽第${i + 1}行△f1为空时, fl1,fr1不能全为空`) break } if (!String(list[i].threeValue) && !String(list[i].fourValue) && !String(list[i].nineValue)) { result = false ElMessage.warning(`中频带宽第${i + 1}行fl2,fr2,△f2不能全为空`) break } if (!String(list[i].nineValue) && (!String(list[i].threeValue) || !String(list[i].fourValue))) { result = false ElMessage.warning(`中频带宽第${i + 1}行△f2为空时, fl2,fr2不能全为空`) break } if (!String(list[i].fiveValue) && !String(list[i].sixValue) && !String(list[i].tenValue)) { result = false ElMessage.warning(`中频带宽第${i + 1}行fl3,fr3,△f3不能全为空`) break } if (!String(list[i].tenValue) && (!String(list[i].fiveValue) || !String(list[i].sixValue))) { result = false ElMessage.warning(`中频带宽第${i + 1}行△f3为空时, fl3,fr3不能全为空`) break } } return result } // 计算单独鉴定项 const caclItem = async (list: IDetailMeasureList[], columns: TableColumn[] | any[], title: string) => { console.log(list, columns, title) if (!checkList(list, columns, title)) { return } if (title === '中频带宽' && !checkIntermediateFrequencyBandwidthList(list)) { return } if (title === '输入频响') { list = list.map((item: any) => ({ ...item, averageValue: ((Number(item.oneValue) + Number(item.twoValue) + Number(item.threeValue)) / 3).toFixed(2) })) } if (title === '谐波失真') { list = list.map((item: any) => ({ ...item, })) } const res = await calculateFun(list.map((item: any) => ({ ...item, technicalIndex: title === '1dB增益压缩点' ? (item.technicalIndex) || '/' : String(item.technicalIndex) ? (clearSymbol(item.technicalIndex) || '/') : '/' }))) return res.map(item => ({ ...item, params: title })) } // 点击计算结果 const calculate = async (title: string, index: string) => { const result = await caclItem(listDict.value[`${index}-${title}`], columnsDict.value[`${index}-${title}`], title) as IDetailMeasureList[] switch (title) { case '频率显示': frequencyList.value = result || frequencyList.value // frequency_unit.value = [...frequency_unit.value] break case '扫频宽度': sweepWidthList.value = result || sweepWidthList.value sweep_width_unit.value = [...sweep_width_unit.value] break case '中频带宽': intermediateFrequencyBandwidthList.value = result || intermediateFrequencyBandwidthList.value intermediate_frequency_bandwidth_unit.value = [...intermediate_frequency_bandwidth_unit.value] break case '中频带宽转换偏差': transitionDeviationList.value = result || transitionDeviationList.value break case '参考电平': referenceElectricalLevelList.value = result || referenceElectricalLevelList.value // reference_electrical_level_unit.value = [...reference_electrical_level_unit.value, '指标下限', '指标上限', '测量值'] break case '垂直刻度(显示位置从上到下)': verticalGraduatedList.value = result || verticalGraduatedList.value // vertical_graduated_unit.value = [...vertical_graduated_unit.value, '指标下限', '指标上限', '测量值'] break case '输入频响': inputFrequencyResponseList.value = result || inputFrequencyResponseList.value // input_frequency_response_unit.value = [...input_frequency_response_unit.value] break case '平均噪声电平': averageNoiseLevelList.value = result || averageNoiseLevelList.value break case '谐波失真': harmonicDistortionList.value = result || harmonicDistortionList.value break case '输入衰减': inputAttenuatorList.value = result || inputAttenuatorList.value break case '1dB增益压缩点': gainCompressionPointList.value = result || gainCompressionPointList.value break case '校准信号': calibratingSignalList.value = result || calibratingSignalList.value calibrating_signal_unit.value = [...calibrating_signal_unit.value, '测量结果'] break } setListDict() } // 列表 const getList = () => { let arr = [] as IDetailMeasureList[] for (const i in listDict.value) { arr = [...arr, ...listDict.value[i]] } return arr } // ---------------------------------------------------------------------------------------- const isNeverDefineItemCategory = ref(false) // 检定项分类是否是从未定义过的 watch(() => itemFormData.value.itemCategoryName, (newValue) => { if (newValue) { // 判断是否是新增的检定项分类 const index = categoryNameDict.findIndex((item: any) => item === newValue) if (index === -1) { isNeverDefineItemCategory.value = true } else { isNeverDefineItemCategory.value = false } } }) // ------------------------------------------钩子---------------------------------------------- watch(() => props.infoId, (newValue) => { if (newValue) { infoId.value = newValue } }, { immediate: true }) onMounted(() => { if (pageType.value === 'add') { // 从我的任务跳转过来(新增) itemFormData.value.itemId = $route.query.itemId as string// 检定项id itemFormData.value.itemCategoryName = $route.query.itemCategoryName as string// 设备检定项分类名称 itemFormData.value.itemCategoryId = $route.query.itemCategoryId as string// 设备检定项分类名称id itemFormData.value.belongStandardEquipment = $route.query.belongStandardEquipment as string// 标准装置code itemFormData.value.belongStandardEquipmentName = $route.query.belongStandardEquipmentName as string// 标准装置名称 // 查输入值(查检定项管理的详情) fetchItemInfo($route.query.itemId! as string, $route.query.itemCategoryName! as string, $route.query.belongStandardEquipment as string) } else { itemFormData.value.itemCategoryName = $route.query.itemCategoryName as string // 设备检定项分类名称 itemFormData.value.itemCategoryId = $route.query.itemCategoryId as string// 设备检定项分类名称id itemFormData.value.belongStandardEquipment = $route.query.belongStandardEquipment as string// 标准装置code itemFormData.value.belongStandardEquipmentName = $route.query.belongStandardEquipmentName as string// 标准装置名称 fetchInfo() } }) defineExpose({ checkout, itemFormData, templateFormAndTableRef, pageType, getList }) </script> <template> <div class="measure-data-template-detail"> <template-form-and-table ref="templateFormAndTableRef" :page-type="pageType" @change-meter-identify="emits('changeMeterIdentify')" /> <!-- 标签 --> <detail-block v-if="!isNeverDefineItemCategory" :title="pageType !== 'detail' ? '检定数据' : ''" :class="pageType === 'detail' ? 'setBottom' : ''"> <el-radio-group v-if="pageType === 'detail'" v-model="current"> <el-radio-button v-for="item in radioMenus" :key="item.value" :label="item.value"> {{ item.name }} </el-radio-button> </el-radio-group> <el-form v-if="current === 'measure-data'" ref="formRef" :model="itemFormData" label-width="140" label-position="right" style="margin-top: 20px;" > <!-- 外观 --> <el-row v-if="itemFormData.appearanceFunctionCheck === 1"> <el-col :span="12"> <el-form-item label="外观及功能性检查:" prop="appearanceRemark"> <el-input v-model="itemFormData.appearanceRemark" class="full-width-input" autosize type="textarea" :disabled="pageType === 'detail'" /> </el-form-item> </el-col> </el-row> <!-- 频率显示 --> <template-table1 v-if="frequencyList.length" title="频率显示" :data="frequencyList" :columns="columns_frequency" :disabled="pageType === 'detail'" index="1" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="frequency_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[frequency_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '/') || (column.text === '均值' && scope.averageValue && scope.averageValue !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '/')"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '均值' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 扫频宽度 --> <template-table1 v-if="sweepWidthList.length" title="扫频宽度" :data="sweepWidthList" :columns="columns_sweep_width" :disabled="pageType === 'detail'" index="2" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="sweep_width_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[sweep_width_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text.includes('f') && scope[column.value]"> <!-- <span v-for="item in 'GHz'" :key="item" style="display: inline-block;">{{ item }}</span> --> <span style="display: inline-block;">GHz</span> </template> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '/') || (column.text === '均值' && scope.averageValue && scope.averageValue !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '/')"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '均值' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 中频带宽 --> <template-table1 v-if="intermediateFrequencyBandwidthList.length" title="中频带宽" :data="intermediateFrequencyBandwidthList" :columns="columns_intermediate_frequency_bandwidth" :disabled="pageType === 'detail'" index="3" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="intermediate_frequency_bandwidth_unit.includes(column.text) && scope[column.value] && scope[column.value] !== '/'"> <span v-for="item in scope[intermediate_frequency_bandwidth_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '/') || (column.text === '均值' && scope.averageValue && scope.averageValue !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '/')"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '均值' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 中频带宽转换偏差 --> <template-table1 v-if="transitionDeviationList.length" title="中频带宽转换偏差" :data="transitionDeviationList" :columns="columns_transition_deviation" :disabled="pageType === 'detail'" index="4" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="transition_deviation_unit.includes(column.text) && scope[column.value] && scope[column.value] !== '/'"> <span v-for="item in scope[transition_deviation_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="column.text === '测量值' && scope[column.value] && scope[column.value] !== '/'"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="(column.text === '转换偏差' && scope.convertDeviation && scope.convertDeviation !== '/') || (column.text === '指标下限' && scope.lowerConvertDeviation && scope.lowerConvertDeviation !== '参考点' && scope.lowerConvertDeviation !== '/') || (column.text === '指标上限' && scope.upperConvertDeviation && scope.upperConvertDeviation !== '参考点' && scope.upperConvertDeviation !== '/')"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '转换偏差' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 参考电平 --> <template-table1 v-if="referenceElectricalLevelList.length" title="参考电平" :data="referenceElectricalLevelList" :columns="columns_reference_electrical_level" :disabled="pageType === 'detail'" index="5" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="reference_electrical_level_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[reference_electrical_level_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '参考点' && scope.lowerIndex !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '参考点' && scope.upperIndex !== '/') || (column.text === '测量值' && scope.oneValue && scope.oneValue !== '参考点' && scope.oneValue !== '/')"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <!-- <template v-if="column.text === '标准衰减器衰减量'"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> --> <template v-if="column.text === '信号源幅度' && scope.signalSourceAmplitude"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text === '标准衰减器衰减量' && scope.standardAttenuatorAttenuation"> <span v-for="item in scope.standardAttenuatorAttenuationUnit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '测量值' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 垂直刻度(显示位置从上到下) --> <template-table1 v-if="verticalGraduatedList.length" title="垂直刻度(显示位置从上到下)" :data="verticalGraduatedList" :columns="columns_vertical_graduated" :disabled="pageType === 'detail'" index="6" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="vertical_graduated_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[vertical_graduated_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <!-- <template v-if="column.text === '标准衰减器衰减量'"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> --> <!-- 单位 --> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '起点' && scope.lowerIndex !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '起点' && scope.upperIndex !== '/') || (column.text === '测量值' && scope.oneValue && scope.oneValue !== '起点' && scope.oneValue !== '/')"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- <template v-if="column.text === '信号源幅度'"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> --> <template v-if="column.text === '信号源幅度' && scope.signalSourceAmplitude"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text === '标准衰减器衰减量' && scope.standardAttenuatorAttenuation"> <span v-for="item in scope.standardAttenuatorAttenuationUnit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '测量值' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 输入频响 --> <template-table1 v-if="inputFrequencyResponseList.length" title="输入频响" :data="inputFrequencyResponseList" :columns="columns_input_frequency_response" :disabled="pageType === 'detail'" index="7" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="input_frequency_response_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[input_frequency_response_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '参考点' && scope.lowerIndex !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '参考点' && scope.upperIndex !== '/')"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="(column.text === '均值' && scope.lowerIndex && scope[column.value])"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="column.text === '参考点' && scope.averageValue"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text.includes('测量值') && scope[column.value]"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text === '输入频响' && !scope.inputFrequency && scope.conclusion === '参考点'"> 参考点 </template> <template v-if="column.text === '输入频响' && scope.inputFrequency && scope.conclusion !== '参考点'" > dB </template> <!-- 标星 --> <template v-if="column.text === '输入频响' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 平均噪声电平 --> <template-table1 v-if="averageNoiseLevelList.length" title="平均噪声电平" :data="averageNoiseLevelList" :columns="columns_average_noise_level" :disabled="pageType === 'detail'" index="8" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="average_noise_level_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[average_noise_level_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="(column.text === '测量值' && scope[column.value]) || (column.text === '指标上限' && scope.upperIndex !== '' && scope.upperIndex !== '/')"> <span v-for="item in 'dBm/Hz'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text === '修正后结果' && scope.revisedResult && scope.revisedResult !== '/'"> <span v-for="item in 'dBm/Hz'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '修正后结果' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 谐波失真 --> <template-table1 v-if="harmonicDistortionList.length" title="谐波失真" :data="harmonicDistortionList" :columns="columns_harmonic_distortion" :disabled="pageType === 'detail'" index="9" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="harmonic_distortion_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[harmonic_distortion_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="['基波幅度', '二次谐波幅度', '三次谐波幅度', '四次谐波幅度'].includes(column.text) && scope[column.value]"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="['二次谐波失真指标上限'].includes(column.text)"> <span v-for="item in 'dBc'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- --> <template v-if="(column.text === '四次谐波失真指标上限' && scope.upperIndexQuartic && scope.upperIndexQuartic !== '/')"> {{ scope.upperIndexQuartic }} <span v-for="item in 'dBc'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="(column.text === '四次谐波失真指标上限' && scope.upperIndexQuartic === '/')"> / </template> <template v-if="(column.text === '三次谐波失真指标上限' && scope.upperIndexThrice && scope.upperIndexThrice !== '/')"> {{ scope.upperIndexThrice }} <span v-for="item in 'dBc'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="(column.text === '三次谐波失真指标上限' && scope.upperIndexThrice === '/')"> / </template> <!-- || (column.text === '三次谐波失真指标上限' && scope.upperIndexThrice) --> <template v-if="(column.text === '二次谐波失真' && scope.threeValue && scope.threeValue !== '/') || (column.text === '三次谐波失真' && scope.fiveValue && scope.fiveValue !== '/') || (column.text === '四次谐波失真' && scope.sevenValue && scope.sevenValue !== '/')"> <span v-for="item in 'dBc'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '二次谐波幅度' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 输入衰减 --> <template-table1 v-if="inputAttenuatorList.length" title="输入衰减" :data="inputAttenuatorList" :columns="columns_input_attenuator" :disabled="pageType === 'detail'" index="10" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="input_attenuator_unit.includes(column.text) && scope[column.value] && scope[column.value] !== '参考点'"> <span v-for="item in scope[input_attenuator_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="(column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '参考点' && scope.lowerIndex !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '参考点' && scope.upperIndex !== '/')"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="column.text === '测量值' || (column.text === '输入衰减器转换影响' && scope.conclusion !== '参考点' && scope.inputAttenuatorConversionEffect&& scope.inputAttenuatorConversionEffect !== '参考点' && scope.inputAttenuatorConversionEffect !== '/')"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text === '输入衰减器转换影响' && scope.conclusion === '参考点' && !scope.inputAttenuatorConversionEffect"> 参考点 </template> <!-- 标星 --> <template v-if="column.text === '输入衰减器转换影响' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 1dB增益压缩点 --> <template-table1 v-if="gainCompressionPointList.length" title="1dB增益压缩点" :data="gainCompressionPointList" :columns="columns_gain_compression_point" :disabled="pageType === 'detail'" index="11" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <!-- 单位 --> <template v-if="gain_compression_point_unit.includes(column.text) && scope[column.value]"> <span v-for="item in scope[gain_compression_point_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 单位 --> <template v-if="(column.text === '增益压缩' && scope.gainCompression) ||( column.text === '测量值' && scope[column.value])"> <span v-for="item in 'dBm'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <template v-if="column.text === '技术指标' && scope.technicalIndex && scope.technicalIndex !== '/'"> <span v-for="item in 'dB'" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 标星 --> <template v-if="column.text === '增益压缩' && scope.conclusion === '不符合指标'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> <!-- 校准信号 --> <template-table1 v-if="calibratingSignalList.length" title="校准信号" :data="calibratingSignalList" :columns="columns_calibrating_signal" :disabled="pageType === 'detail'" index="12" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false" :need-merge-cells="[]" @calculate-result="calculate" > <template #next-content="{ scope, column }"> <template v-if="column.text === '测量结果' && pageType !== 'detail' "> <div v-if="scope.typeValue === '幅度'" style="width: 100%;text-align: center;"> {{ scope.measureResult }} </div> <template v-else> <precision-input-number v-model="scope.measureResult" controls-position="right" :placeholder="pageType === 'detail' ? '' : '测量结果'" :disabled="pageType === 'detail'" style="width: 140px;margin: 0 10px;" /> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- && !scope.measureResult && scope.typeValue === '频率' / --> </template> <template v-if="column.text === '测量结果' && pageType === 'detail'"> {{ scope.measureResult }} </template> <!-- 单位 --> <template v-if="calibrating_signal_unit.includes(column.text) && scope[column.value] && scope[column.value] !== '/'"> <span v-for="item in scope[calibrating_signal_dict[column.text]]" :key="item" style="display: inline-block;">{{ item }}</span> </template> <!-- 测量值 --> <template v-if="pageType !== 'detail'"> <template v-if="column.text === '测量值1'"> <div v-if="scope.typeValue === '频率'" style="width: 100%;text-align: center;"> / </div> <template v-else> <precision-input-number v-model="scope.oneValue" :placeholder="pageType === 'detail' ? '' : '测量值1'" :disabled="pageType === 'detail'" controls-position="right" style="width: 140px;margin: 0 10px;" /> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> </template> <template v-if="column.text === '测量值2'"> <div v-if="scope.typeValue === '频率'" style="width: 100%;text-align: center;"> / </div> <template v-else> <precision-input-number v-model="scope.twoValue" :placeholder="pageType === 'detail' ? '' : '测量值2'" :disabled="pageType === 'detail'" controls-position="right" style="width: 140px;margin: 0 10px;" /> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> </template> <template v-if="column.text === '测量值3'"> <div v-if="scope.typeValue === '频率'" style="width: 100%;text-align: center;"> / </div> <template v-else> <precision-input-number v-model="scope.threeValue" controls-position="right" :placeholder="pageType === 'detail' ? '' : '测量值3'" :disabled="pageType === 'detail'" style="width: 140px;margin: 0 10px;" /> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> </template> <template v-if=" (column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '/') || (column.text === '指标上限' && scope.upperIndex) && scope.upperIndex !== '/'"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> </template> <template v-else> <template v-if="column.text === '测量值1'"> <div v-if="scope.typeValue === '频率'" style="width: 100%;text-align: center;"> / </div> <template v-else> {{ scope.oneValue }} </template> </template> <template v-if="column.text === '测量值2'"> <div v-if="scope.typeValue === '频率'" style="width: 100%;text-align: center;"> / </div> <template v-else> {{ scope.twoValue }} </template> </template> <template v-if="column.text === '测量值3'"> <div v-if="scope.typeValue === '频率'" style="width: 100%;text-align: center;"> / </div> <template v-else> {{ scope.threeValue }} </template> </template> <template v-if="(column.text === '测量值1' && scope.oneValue !== '/') || (column.text === '测量值2' && scope.twoValue !== '/') || (column.text === '测量值3' && scope.threeValue !== '/') || (column.text === '指标下限' && scope.lowerIndex && scope.lowerIndex !== '/') || (column.text === '指标上限' && scope.upperIndex && scope.upperIndex !== '/')"> <span v-for="item in scope.unit" :key="item" style="display: inline-block;">{{ item }}</span> </template> </template> <!-- 标星 --> <template v-if="column.text.includes('测量值') && scope.conclusion === '不符合指标' && scope.typeValue === '幅度'"> <span style="display: inline-block; color: red;">*</span> </template> </template> </template-table1> </el-form> <!-- 历史修改记录 --> <change-record v-if="pageType === 'detail' && current === 'change-record'" :info-id="infoId" /> </detail-block> </div> </template> <style lang="scss"> .measure-data-template-detail { .el-radio__label { display: block !important; } } </style>