Newer
Older
xc-business-system / src / views / business / taskMeasure / measureData / components / fourteen / components / clock.vue
lyg on 14 Jun 2024 39 KB 铯原子问题修改
<!-- 第14套:铯原子标准装置 -- 铷钟 -->
<!-- 检定数据管理详情模板 -->
<script lang="ts" setup name="MeasureDataTemplateDetail">
import { ElLoading, ElMessage } from 'element-plus'
import dayjs from 'dayjs'
import selectStandard from '../../../dialog/selectStandardDialog.vue'
import changeRecord from '../../changeRecord.vue'
import TemplateFormAndTable from '../../templateFormAndTable.vue'
import { useSolveFormData } from '../../useSolveFormData'
import type { IDetailMeasureList } from '../fourteen-interface'
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 templateTable from '@/views/business/measure/item/components/second/templateTable.vue'
import { clearSymbol, clearSymbolStart } from '@/utils/String'
const props = defineProps({
  infoId: String, // id
  dataNo: String, // 检定数据编号
})
const emits = defineEmits(['giveInfoId'])
const user = useUserStore() // 用户信息
const $router = useRouter() // 关闭页面使用
const $route = useRoute() // 路由参数
const ruleFormRef = ref() // 表单ref
const templateFormAndTableRef = ref() // 表单和被检设备、测量设备表格公共组件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 outputSignalList = ref<any[]>([]) // 输出信号
const warmUpList = ref<any[]>([]) // 开机特性
const frequencyReproducibilityList = ref<any[]>([]) // 频率复现性
const relativeFrequencyDeviationList = ref<any[]>([]) // 相对频率偏差
const frequencyStabilityList = ref<any[]>([]) // 频率稳定度
const dailyFrequencyDriftRateList = ref<any[]>([]) // 日频率漂移率
const listDict = ref<{ [key: string]: any[] }>({})
const setListDict = () => {
  listDict.value = {
    '1-输出信号': outputSignalList.value,
    '2-开机特性': warmUpList.value,
    '3-频率复现性': frequencyReproducibilityList.value,
    '4-相对频率偏差': relativeFrequencyDeviationList.value,
    '5-频率稳定度': frequencyStabilityList.value,
    '6-日频率漂移率': dailyFrequencyDriftRateList.value,
  }
}
const columns_output_signal = ref<TableColumn[]>([ // 输出信号
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '信号类型', value: 'signalType', align: 'center', required: false, type: 'text' },
  { text: '被测信号频率', value: 'testedSignalFrequency', align: 'center', required: false, type: '' },
  { text: '幅度', value: 'amplitude', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '脉冲宽度', value: 'pulseWidth', align: 'center', required: false, type: '' },
  { text: '上升时间', value: 'riseTime', align: 'center', required: false, type: '' },
  { text: '幅度技术指标', value: '', align: 'center', required: false, type: '' },
  { text: '脉冲宽度技术指标', value: '', align: 'center', required: false, type: '' },
  { text: '上升时间技术指标', value: '', align: 'center', required: false, type: '' },
  { text: '不确定度U(k=2)', value: 'urel', align: 'center', required: false, type: 'text' },
  { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
])
const columns_warm_up = ref<TableColumn[]>([ // 开机特性
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '被测信号频率', value: 'testedSignalFrequency', align: 'center', required: false, type: 'text' },
  { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
  { text: '倍增次数', value: 'multiplyFrequency', align: 'center', required: false, type: 'text' },
  { text: '开机时间', value: 'onTime', align: 'center', required: false, type: 'text' },
  { text: '相对频率偏差y(τ)', value: 'relativeFrequencyDeviationOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' },
  { text: '不确定度U(k=2)', value: 'urel', align: 'center', required: false, type: 'text' },
  { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
])
const columns_frequency_reproducibility = ref<TableColumn[]>([ // 频率复现性
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '被测信号频率', value: 'testedSignalFrequency', align: 'center', required: false, type: 'text' },
  { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
  { text: '倍增次数', value: 'multiplyFrequency', align: 'center', required: false, type: 'text' },
  { text: 'T1', value: 'tOne', align: 'center', required: false, type: 'text' },
  { text: 'T2', value: 'tTwo', align: 'center', required: false, type: 'text' },
  { text: 'T3', value: 'tThree', align: 'center', required: false, type: 'text' },
  { text: '相对频率偏差γ1(τ)', value: 'relativeFrequencyDeviationOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '相对频率偏差γ2(τ)', value: 'relativeFrequencyDeviationTwo', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '频率复现性R', value: 'frequencyReproducibility', align: 'center', required: false, type: 'text' },
  { text: '技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' },
  { text: '不确定度U(k=2)', value: 'urel', align: 'center', required: false, type: 'text' },
  { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
])
const columns_relative_frequency_deviation = ref<TableColumn[]>([ // 相对频率偏差
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '被测信号频率', value: 'testedSignalFrequency', align: 'center', required: false, type: 'text' },
  { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
  { text: '倍增次数', value: 'multiplyFrequency', align: 'center', required: false, type: 'text' },
  { text: '开机时间', value: 'onTime', align: 'center', required: false, type: 'text' },
  { text: '相对频率偏差y(τ)', value: 'relativeFrequencyDeviationOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' },
  { text: '不确定度U(k=2)', value: 'urel', align: 'center', required: false, type: 'text' },
  { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
])
const columns_frequency_stability = ref<TableColumn[]>([ // 频率稳定度
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '被测信号频率', value: 'testedSignalFrequency', align: 'center', required: false, type: 'text' },
  { text: '取样时间', value: 'sampleTime', align: 'center', required: false, type: 'text' },
  { text: '采样组数', value: 'sampleGroupNumber', align: 'center', required: false, type: 'text' },
  { text: '频率稳定度σy(τ)', value: 'frequencyStability', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' },
  { text: '不确定度uc', value: 'urel', align: 'center', required: false, type: 'text' },
  { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
])
const columns_daily_frequency_drift_rate = ref<TableColumn[]>([ // 日频率漂移率
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '被测信号频率', value: 'testedSignalFrequency', align: 'center', required: false, type: 'text' },
  { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
  { text: '取样时间', value: 'sampleTime', align: 'center', required: false, type: 'text' },
  { text: '采样组数', value: 'sampleGroupNumber', align: 'center', required: false, type: 'text' },
  // { text: '序号', value: 'sweepWidthUnit', align: 'center', required: false, type: 'text' },
  { text: '相对频率偏差y(τ)', value: 'relativeFrequencyDeviationOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '日漂移率K(计算值)', value: 'dailyAgingRateOne', align: 'center', required: false, type: '', customContent: true },
  { text: '相关系数r(计算值)', value: 'correlationCoefficientOne', align: 'center', required: false, type: '', customContent: true },
  { text: '日漂移率K(给出值)', value: 'dailyAgingRateTwo', align: 'center', required: false, type: 'text' },
  { text: '相关系数r(给出值)', value: 'correlationCoefficientTwo', align: 'center', required: false, type: 'text' },
  { text: '技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' },
  { text: '不确定度U(k=2)', value: 'urel', align: 'center', required: false, type: 'text' },
  { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
])
const columnsDict = ref<{ [key: string]: any[] | TableColumn[] }>({
  '1-输出信号': columns_output_signal.value,
  '2-开机特性': columns_warm_up.value,
  '3-频率复现性': columns_frequency_reproducibility.value,
  '4-相对频率偏差': columns_relative_frequency_deviation.value,
  '5-频率稳定度': columns_frequency_stability.value,
  '6-日频率漂移率': columns_daily_frequency_drift_rate.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((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 // 外观及功能检查

    console.log(res, 'res')
    initInputData(res.data.measureDataCesiumAtomList)
    // =======================================表单公共组件数据处理=======================================================
    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] = []
  }
  outputSignalList.value = []
  warmUpList.value = []
  frequencyReproducibilityList.value = []
  relativeFrequencyDeviationList.value = []
  frequencyStabilityList.value = []
  dailyFrequencyDriftRateList.value = []
}
// 初始化输入数据
function initInputData(data: any) {
  initAllData()
  data.forEach((item: any) => {
    switch (item.dataType) {
      case '1':
        // 输出信号
        outputSignalList.value.push({ ...item, params: '输出信号', amplitude: item.amplitude || '', pulseWidth: item.pulseWidth || '', riseTime: item.riseTime || '', technicalIndex: item.technicalIndex.includes('/') ? '/' : item.technicalIndex || '' })
        break
      case '2':
        // 开机特性
        warmUpList.value.push({ ...item, params: '开机特性', technicalIndex: item.technicalIndex.includes('/') ? '/' : item.technicalIndex || '', relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '' })
        break
      case '3':
        // 频率复现性
        frequencyReproducibilityList.value.push({ ...item, params: '频率复现性', technicalIndex: item.technicalIndex.includes('/') ? '/' : item.technicalIndex || '', relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '', relativeFrequencyDeviationTwo: item.relativeFrequencyDeviationTwo || '', frequencyReproducibility: item.frequencyReproducibility || '' })
        break
      case '4':
        // 相对频率偏差
        relativeFrequencyDeviationList.value.push({ ...item, params: '相对频率偏差', technicalIndex: item.technicalIndex.includes('/') ? '/' : item.technicalIndex || '', relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '' })
        break
      case '5':
        // 频率稳定度
        frequencyStabilityList.value.push({ ...item, params: '频率稳定度', technicalIndex: item.technicalIndex.includes('/') ? '/' : item.technicalIndex || '', frequencyStability: item.frequencyStability || '' })
        break
      case '6':
        // 日频率漂移率
        dailyFrequencyDriftRateList.value.push({
          ...item,
          params: '日频率漂移率',
          technicalIndex: item.technicalIndex.includes('/') ? '/' : item.technicalIndex || '',
          relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '',
          dailyAgingRateOne: item.dailyAgingRateOne || '',
          correlationCoefficientOne: item.correlationCoefficientOne || '',
        })
        break
    }
  })
  // 日频率漂移率 采样组数
  if (dailyFrequencyDriftRateList.value.length) {
    const num = dailyFrequencyDriftRateList.value.length
    if (num !== Number(dailyFrequencyDriftRateList.value[0].sampleGroupNumber)) {
      for (let i = 0; i < (Number(dailyFrequencyDriftRateList.value[0].sampleGroupNumber) - num); i++) {
        dailyFrequencyDriftRateList.value.push(JSON.parse(JSON.stringify(dailyFrequencyDriftRateList.value[0])))
      }
    }
    dailyFrequencyDriftRateList.value = dailyFrequencyDriftRateList.value.map((item: any, index: number) => ({ ...item, serialNumber: index + 1, dailyAgingRateOne: dailyFrequencyDriftRateList.value[0].dailyAgingRateOne, correlationCoefficientOne: dailyFrequencyDriftRateList.value[0].correlationCoefficientOne }))
  }
  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没有外观
    initInputData(res.data.measureItemDataCesiumAtomList)
  })
}

// ----------------------------------------点击保存时校验---------------------------------------
// 校验
const checkout = () => {
}
function checkList(list: any[], 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, // 检定项分类名称
    measureDataCesiumAtomList: list.map((item: any) => ({ ...item, technicalIndex: clearSymbol(item.technicalIndex) ? item.technicalIndex : '/' })),
  }
  const res = await calculateHandle(params)
  result = res.data
  return result
}
// 计算单独鉴定项
const caclItem = async (list: any[], columns: TableColumn[] | any[], title: string) => {
  if (!checkList(list, columns, title)) { return }
  if (title === '日频率漂移率') {
    list = list.map((item: any, index: number) => ({ ...item, dailyAgingRateOne: list[0].dailyAgingRateOne, correlationCoefficientOne: list[0].correlationCoefficientOne }))
  }
  const res = await calculateFun(list)
  return res.map(item => ({ ...item, params: title, technicalIndex: clearSymbol(item.technicalIndex || '+') ? clearSymbol(item.technicalIndex || '+') : '/' }))
}
// 点击计算结果
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 '输出信号':
      outputSignalList.value = result || outputSignalList.value
      break
    case '开机特性':
      warmUpList.value = result || warmUpList.value
      break
    case '频率复现性':
      frequencyReproducibilityList.value = result || frequencyReproducibilityList.value
      break
    case '相对频率偏差':
      relativeFrequencyDeviationList.value = result || relativeFrequencyDeviationList.value
      break
    case '频率稳定度':
      frequencyStabilityList.value = result || frequencyStabilityList.value
      break
    case '日频率漂移率':
      dailyFrequencyDriftRateList.value = result || dailyFrequencyDriftRateList.value
      break
  }
  setListDict()
}

// 列表
const getList = () => {
  let arr = [] as IDetailMeasureList[]
  for (const i in listDict.value) {
    arr = [...arr, ...listDict.value[i]]
  }
  return arr
}

// ------------------------------------------钩子----------------------------------------------
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 })

// 折线图绘制
// 折线图 x轴 数据
const xAxisData = ref([])
// 折线图y轴数据
const yAxisData = ref([])
const isShowChart = ref(false)
watch(() => dailyFrequencyDriftRateList.value, (newVal) => {
  if (newVal && newVal?.length) {
    // 判断是否通过验证
    // if (useCheckList(dailyFrequencyDriftRateList.value, columns_daily_frequency_drift_rate.value, '日频率漂移率') && String(dailyFrequencyDriftRateList.value[0].dailyAgingRateOne)) {
    //   isShowChart.value = true
    xAxisData.value = dailyFrequencyDriftRateList.value.map((item: { serialNumber: string | number }) => item.serialNumber) as any[]
    if (Math.abs(dailyFrequencyDriftRateList.value[0].correlationCoefficientOne) >= 0.6) {
      // 两条曲线
      yAxisData.value = [{ name: '相对频率偏差', symbol: 'rect', data: dailyFrequencyDriftRateList.value.map((item: { relativeFrequencyDeviationOne: string | number }) => item.relativeFrequencyDeviationOne), color: '#000080' },
        { name: '日频率漂移率', symbol: 'none', data: dailyFrequencyDriftRateList.value.map((item: { dailyAgingRateOrdinate: string | number }) => item.dailyAgingRateOrdinate), color: '#000000' },

      ] as any
      console.log(yAxisData.value, 'yAxisData.value')
    }
    else {
      // 一条曲线
      yAxisData.value = [{ name: '相对频率偏差', symbol: 'rect', data: dailyFrequencyDriftRateList.value.map((item: { relativeFrequencyDeviationOne: string | number }) => item.relativeFrequencyDeviationOne) }] as any
    }
    // }
    // else {
    //   isShowChart.value = false
    // }
  }
}, {
  deep: true,
})
</script>

<template>
  <div class="measure-data-template-detail">
    <template-form-and-table ref="templateFormAndTableRef" :page-type="pageType" />
    <!-- 标签 -->
    <detail-block :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-table
          v-if="outputSignalList.length" title="输出信号" :data="outputSignalList"
          :columns="columns_output_signal" :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="column.text === '被测信号频率'">
              <span> {{ scope.signalType === '频率信号' ? scope.testedSignalFrequency : '/' }}</span>
              <template v-if="scope.signalType === '频率信号'">
                <span v-for="item in scope.testedSignalFrequencyUnit" :key="item" style="display: inline-block;">{{ item
                }}</span>
              </template>
            </template>
            <template v-if="column.text === '幅度'">
              <span v-for="item in scope.amplitudeTechnicalIndexUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '脉冲宽度'">
              <precision-input-number
                v-if="pageType !== 'detail' && scope.signalType === '秒脉冲信号'" v-model="scope.pulseWidth"
                style="width: 100%;" controls-position="right"
              />
              <span v-if="pageType !== 'detail' && scope.signalType !== '秒脉冲信号'"> {{ '/' }}</span>
              <span v-if="pageType === 'detail'"> {{ scope.pulseWidth ? scope.pulseWidth : '/' }}</span>
              <template v-if="scope.signalType === '秒脉冲信号'">
                <span v-for="item in scope.pulseWidthTechnicalIndexUnit" :key="item" style="display: inline-block;">{{
                  item }}</span>
              </template>
            </template>
            <template v-if="column.text === '上升时间'">
              <precision-input-number
                v-if="pageType !== 'detail' && scope.signalType === '秒脉冲信号'" v-model="scope.riseTime"
                style="width: 100%;" controls-position="right"
              />
              <span v-if="pageType !== 'detail' && scope.signalType !== '秒脉冲信号'"> {{ '/' }}</span>
              <span v-if="pageType === 'detail'"> {{ scope.riseTime ? scope.riseTime : '/' }}</span>
              <template v-if="scope.signalType === '秒脉冲信号'">
                <span v-for="item in scope.technicalIndexUnit" :key="item" style="display: inline-block;">{{ item
                }}</span>
              </template>
            </template>
            <template v-if="column.text === '幅度技术指标'">
              <template v-if="scope.signalType === '秒脉冲信号'">
                /
              </template>
              <template v-else>
                <span v-for="item in scope.amplitudeTechnicalIndexLower" :key="item" style="display: inline-block;">{{
                  item }}</span>
                <span>~</span>
                <span v-for="item in scope.amplitudeTechnicalIndexUpper" :key="item" style="display: inline-block;">{{
                  item }}</span>
                <span v-for="item in scope.amplitudeTechnicalIndexUnit" :key="item" style="display: inline-block;">{{
                  item }}</span>
              </template>
            </template>
            <template v-if="column.text === '脉冲宽度技术指标'">
              <template v-if="scope.signalType === '秒脉冲信号'">
                <span v-for="item in scope.pulseWidthTechnicalIndexLower" :key="item" style="display: inline-block;">{{
                  item }}</span>
                <span>~</span>
                <span v-for="item in scope.pulseWidthTechnicalIndexUpper" :key="item" style="display: inline-block;">{{
                  item }}</span>
                <span v-for="item in scope.pulseWidthTechnicalIndexUnit" :key="item" style="display: inline-block;">{{
                  item }}</span>
              </template>
              <template v-else>
                /
              </template>
            </template>
            <template v-if="column.text === '上升时间技术指标'">
              <template v-if="scope.signalType === '秒脉冲信号'">
                <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
                }}</span>
                <span v-for="item in scope.technicalIndex" :key="item" style="display: inline-block;">{{ item }}</span>
                <span v-for="item in scope.technicalIndexUnit" :key="item" style="display: inline-block;">{{ item
                }}</span>
              </template>
              <template v-else>
                /
              </template>
            </template>

            <span
              v-if="(scope.exceedMark === 1 || scope.exceedMark === '1') && column.text === '幅度' && scope.amplitude"
              style="display: inline-block; color: red;"
            >*</span>
            <span
              v-if="(scope.exceedMarkOne === 1 || scope.exceedMarkOne === '1') && column.text === '脉冲宽度' && scope.pulseWidth"
              style="display: inline-block; color: red;"
            >*</span>
            <span
              v-if="(scope.exceedMarkTwo === 1 || scope.exceedMarkTwo === '1') && column.text === '上升时间' && scope.riseTime"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 开机特性 -->
        <template-table
          v-if="warmUpList.length" title="开机特性" :data="warmUpList" :columns="columns_warm_up"
          :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 #pre-content="{ scope, column }">
            <template v-if="column.text === '技术指标' && scope.technicalIndex && scope.technicalIndex !== '/'">
              <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
          </template>
          <template #next-content="{ scope, column }">
            <template v-if="column.text === '被测信号频率'">
              <span v-for="item in scope.testedSignalFrequencyUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '闸门时间'">
              <span v-for="item in scope.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === '开机时间'">
              <span v-for="item in scope.onTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '相对频率偏差y(τ)'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 频率复现性 -->
        <template-table
          v-if="frequencyReproducibilityList.length" title="频率复现性" :data="frequencyReproducibilityList"
          :columns="columns_frequency_reproducibility" :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 #pre-content="{ scope, column }">
            <template v-if="column.text === '技术指标' && scope.technicalIndex && scope.technicalIndex !== '/'">
              <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
          </template>
          <template #next-content="{ scope, column }">
            <template v-if="column.text === '被测信号频率'">
              <span v-for="item in scope.testedSignalFrequencyUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '闸门时间'">
              <span v-for="item in scope.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === 'T1'">
              <span v-for="item in scope.tOneUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === 'T3'">
              <span v-for="item in scope.tThreeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === 'T2'">
              <span v-for="item in scope.tTwoUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '频率复现性R'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 相对频率偏差 -->
        <template-table
          v-if="relativeFrequencyDeviationList.length" title="相对频率偏差"
          :data="relativeFrequencyDeviationList" :columns="columns_relative_frequency_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 #pre-content="{ scope, column }">
            <template v-if="column.text === '技术指标' && scope.technicalIndex && scope.technicalIndex !== '/'">
              <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
          </template>
          <template #next-content="{ scope, column }">
            <template v-if="column.text === '被测信号频率'">
              <span v-for="item in scope.testedSignalFrequencyUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '开机时间'">
              <span v-for="item in scope.onTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === '闸门时间'">
              <span v-for="item in scope.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '相对频率偏差y(τ)'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 频率稳定度 -->
        <template-table
          v-if="frequencyStabilityList.length" title="频率稳定度" :data="frequencyStabilityList"
          :columns="columns_frequency_stability" :disabled="pageType === 'detail'" index="5" :show-btn="false"
          :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false"
          :need-merge-cells="['testedSignalFrequency']" @calculate-result="calculate"
        >
          <template #pre-content="{ scope, column }">
            <template v-if="column.text === '技术指标' && scope.technicalIndex && scope.technicalIndex !== '/'">
              <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
          </template>
          <template #next-content="{ scope, column }">
            <template v-if="column.text === '被测信号频率'">
              <span v-for="item in scope.testedSignalFrequencyUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '取样时间'">
              <span v-for="item in scope.sampleTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '频率稳定度σy(τ)'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 日频率漂移率 -->
        <template-table
          v-if="dailyFrequencyDriftRateList.length" title="日频率漂移率" :data="dailyFrequencyDriftRateList"
          :columns="columns_daily_frequency_drift_rate" :disabled="pageType === 'detail'" index="6" :show-btn="false"
          :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false"
          :need-merge-cells="['dailyAgingRateOne', 'correlationCoefficientOne']" @calculate-result="calculate"
        >
          <template #pre-content="{ scope, column }">
            <template v-if="column.text === '技术指标' && scope.technicalIndex && scope.technicalIndex !== '/'">
              <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
          </template>
          <template #next-content="{ scope, column }">
            <template v-if="column.text === '被测信号频率'">
              <span v-for="item in scope.testedSignalFrequencyUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '闸门时间'">
              <span v-for="item in scope.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === '取样时间'">
              <span v-for="item in scope.sampleTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
          </template>
          <template #custom-content="{ scope, column }">
            {{ scope.row }}
            <template v-if="column.text === '日漂移率K(计算值)'">
              <!-- <el-input-number
                v-if="pageType !== 'detail'" v-model="scope.dailyAgingRateOne" style="width: 100%;"
                controls-position="right"
              /> -->
              <scientific-notation v-if="pageType !== 'detail'" v-model="scope.dailyAgingRateOne" style="width: 100%;" :required="true" />
              <span v-else> {{ scope.dailyAgingRateOne }}</span>
              <span v-if="scope.conclusion === '不符合指标'" style="display: inline-block; color: red;">*</span>
            </template>
            <template v-if="column.text === '相关系数r(计算值)'">
              <!-- <el-input-number
                v-if="pageType !== 'detail'" v-model="scope.correlationCoefficientOne"
                style="width: 100%;" controls-position="right"
              /> -->
              <scientific-notation v-if="pageType !== 'detail'" v-model="scope.correlationCoefficientOne" style="width: 100%;" :required="true" />
              <span v-else> {{ scope.correlationCoefficientOne }}</span>
            </template>
          </template>
        </template-table>
        <!-- 折线图 -->
        <div v-if="dailyFrequencyDriftRateList.length && isShowChart" style="width: 100%; height: 360px;">
          <line-chart
            v-if="dailyFrequencyDriftRateList.length && isShowChart" style="width: 80%;margin: 0 auto;"
            :smooth="false" :gradient="false" :x-axis-data="xAxisData" :data="yAxisData"
          />
        </div>
      </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>