Newer
Older
xc-business-system / src / views / business / taskMeasure / measureData / components / fourteen / components / universalCounter.vue
dutingting on 2 Dec 58 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 categoryNameDict from '/public/config/categoryNameDict.json'
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, // 检定数据编号
  itemCategoryName: String, // 检定项分类名称
})
const emits = defineEmits(['giveInfoId', 'changeMeterIdentify'])
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)
  remark: '',
})
// -------------------------------------------路由参数------------------------------------------
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 crystalOscillatorStartupCharacterList = ref<any[]>([]) // 晶振开机特性
const crystalOscillatorStabilityList = ref<any[]>([]) // 晶振1s频率稳定度
const crystalOscillatorDeviationList = ref<any[]>([]) // 晶振相对频率偏差
const crystalOscillatorReproducibilityList = ref<any[]>([]) // 晶振频率复现性
const crystalOscillatorDailyAgingRateList = ref<any[]>([]) // 晶振日老化率
const frequencyMeasureRangeList = ref<any[]>([]) // 频率测量范围、输入灵敏度
const frequencyMeasureErrorList = ref<any[]>([]) // 频率测量误差
const periodicMeasureRangeList = ref<any[]>([]) // 周期测量范围、输入灵敏度
const periodicMeasureErrorList = ref<any[]>([]) //  周期测量误差
const timeIntervalMeasureRangeList = ref<any[]>([]) // 时间间隔测量范围及测量误差
const listDict = ref<{ [key: string]: any[] }>({})
const setListDict = () => {
  listDict.value = {
    '1-晶振开机特性': crystalOscillatorStartupCharacterList.value,
    '2-晶振1s频率稳定度': crystalOscillatorStabilityList.value,
    '3-晶振相对频率偏差': crystalOscillatorDeviationList.value,
    '4-晶振频率复现性': crystalOscillatorReproducibilityList.value,
    '5-晶振日老化率': crystalOscillatorDailyAgingRateList.value,
    '6-频率测量范围、输入灵敏度': frequencyMeasureRangeList.value,
    '6-频率测量范围、输入灵敏度及最大输入电平': frequencyMeasureRangeList.value,
    '7-频率测量误差': frequencyMeasureErrorList.value,
    '8-周期测量范围、输入灵敏度': periodicMeasureRangeList.value,
    '9-周期测量误差': periodicMeasureErrorList.value,
    '10-时间间隔测量范围及测量误差': timeIntervalMeasureRangeList.value,
  }
}
const columns_crystal_oscillator_startup_character = ref<TableColumn[]>([ // 晶振开机特性
  { text: '检定项目', value: 'params', 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: 'unit', align: 'center', required: false, type: 'text' },
  { text: '相对频率偏差y(τ)', value: 'relativeFrequencyDeviationOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '开机特性V', value: 'startupCharacter', 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_crystal_oscillator_stability = ref<TableColumn[]>([ // 晶振1s频率稳定度
  { text: '检定项目', value: 'params', 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: '频率稳定度σ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_crystal_oscillator_deviation = ref<TableColumn[]>([ // 晶振相对频率偏差
  { text: '检定项目', value: 'params', 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: '相对频率偏差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_crystal_oscillator_reproducibility = ref<TableColumn[]>([ // 晶振频率复现性
  { text: '检定项目', value: 'params', 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/T3', value: 'tOne', align: 'center', required: false, type: 'text' },
  { text: 'T2', value: 'tTwo', 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_crystal_oscillator_dailyAging_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: 'unit', align: 'center', required: false, type: 'text' },
  { text: '相对频率偏差γ(τ)', 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 columns_frequency_measure_range = ref<TableColumn[]>(
  props.itemCategoryName === '通用计数器'
    ? [ // 频率测量范围、输入灵敏度
        { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
        { text: '通道', value: 'thoroughfare', align: 'center', required: false, type: 'text' },
        { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
        { text: '输入灵敏度', value: 'inputSensitivity', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '有效分辨力', value: 'effectiveResolution', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '有效分辨力单位', value: 'effectiveResolutionUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
        { text: '输入灵敏度技术指标', value: 'urel', align: 'center', required: false, type: 'text' },
        { text: '结论', value: 'conclusion', align: 'center', required: false, type: 'text' },
      ]
    : [
        { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
        { text: '通道', value: 'thoroughfare', align: 'center', required: false, type: 'text' },
        { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
        { text: '输入灵敏度', value: 'inputSensitivity', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '最大输入电平', value: 'maxInputLevel', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '输入灵敏度技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' },
        { text: '最大输入电平技术指标', value: 'otherTechnicalIndex', 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_measure_error = ref<TableColumn[]>(
  props.itemCategoryName === '通用计数器'
    ? [ // 频率测量误差
        { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
        { text: '通道', value: 'thoroughfare', align: 'center', required: false, type: 'text' },
        { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
        { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
        { text: '测量值1', value: 'testValueOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '测量值2', value: 'testValueTwo', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '测量值3', value: 'testValueThree', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '测量值误差', value: 'testValueError', align: 'center', required: false, type: 'text' },
        { text: '有效分辨力', value: 'effectiveResolution', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '有效分辨力单位', value: 'effectiveResolutionUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
        { 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' },
      ]
    : [
        { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
        { text: '通道', value: 'thoroughfare', align: 'center', required: false, type: 'text' },
        { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
        { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
        { text: '测量值1', value: 'testValueOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '测量值2', value: 'testValueTwo', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '测量值3', value: 'testValueThree', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        { text: '测量值误差', value: 'testValueError', align: 'center', required: false, type: 'text' },
        // { text: '有效分辨力', value: 'effectiveResolution', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
        // { text: '有效分辨力单位', value: 'effectiveResolutionUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
        { 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_periodic_measure_range = ref<TableColumn[]>([ // 周期测量范围、输入灵敏度
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '通道', value: 'thoroughfare', align: 'center', required: false, type: 'text' },
  { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
  { text: '输入灵敏度', value: 'inputSensitivity', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  // { text: '输入灵敏度单位', value: 'inputSensitivityUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
  { text: '有效分辨力', value: 'effectiveResolution', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '有效分辨力单位', value: 'effectiveResolutionUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
  { 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_periodic_measure_error = ref<TableColumn[]>([ // 周期测量误差
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '通道', value: 'thoroughfare', align: 'center', required: false, type: 'text' },
  { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
  { text: '闸门时间', value: 'gateTime', align: 'center', required: false, type: 'text' },
  { text: '测量值1', value: 'testValueOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '测量值2', value: 'testValueTwo', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '测量值3', value: 'testValueThree', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '测量值误差', value: 'testValueError', align: 'center', required: false, type: 'text' },
  { text: '有效分辨力', value: 'effectiveResolution', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '有效分辨力单位', value: 'effectiveResolutionUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
  { 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_time_interval_measure_range = ref<TableColumn[]>([ // 时间间隔测量范围及测量误差
  { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' },
  { text: '标称值', value: 'nominalValue', align: 'center', required: false, type: 'text' },
  { text: '测量值1', value: 'testValueOne', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '测量值2', value: 'testValueTwo', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '测量值3', value: 'testValueThree', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '测量值误差', value: 'testValueError', align: 'center', required: false, type: 'text' },
  { text: '有效分辨力', value: 'effectiveResolution', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' },
  { text: '有效分辨力单位', value: 'effectiveResolutionUnit', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'select' },
  { 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_crystal_oscillator_startup_character.value,
  '2-晶振1s频率稳定度': columns_crystal_oscillator_stability.value,
  '3-晶振相对频率偏差': columns_crystal_oscillator_deviation.value,
  '4-晶振频率复现性': columns_crystal_oscillator_reproducibility.value,
  '5-晶振日老化率': columns_crystal_oscillator_dailyAging_rate.value,
  '6-频率测量范围、输入灵敏度': columns_frequency_measure_range.value,
  '6-频率测量范围、输入灵敏度及最大输入电平': columns_frequency_measure_range.value,
  '7-频率测量误差': columns_frequency_measure_error.value,
  '8-周期测量范围、输入灵敏度': columns_periodic_measure_range.value,
  '9-周期测量误差': columns_periodic_measure_error.value,
  '10-时间间隔测量范围及测量误差': columns_time_interval_measure_range.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 // 外观及功能检查
    itemFormData.value.remark = res.data.remark // 外观及功能检查
    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] = []
  }
  crystalOscillatorStartupCharacterList.value = []
  crystalOscillatorStabilityList.value = []
  crystalOscillatorDeviationList.value = []
  crystalOscillatorReproducibilityList.value = []
  crystalOscillatorDailyAgingRateList.value = []
  frequencyMeasureRangeList.value = []
  frequencyMeasureErrorList.value = []
  periodicMeasureRangeList.value = []
  periodicMeasureErrorList.value = []
  timeIntervalMeasureRangeList.value = []
}
// 初始化输入数据
function initInputData(data: any) {
  initAllData()
  data.forEach((item: any) => {
    switch (item.dataType) {
      case '1':
        // 晶振开机特性
        crystalOscillatorStartupCharacterList.value.push({ ...item, params: '晶振开机特性', gateTimeUnit: 's', relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '', technicalIndex: item.technicalIndex || '/' })
        break
      case '2':
        // 晶振1s频率稳定度
        crystalOscillatorStabilityList.value.push({ ...item, params: '晶振1s频率稳定度', gateTimeUnit: 's', technicalIndex: item.technicalIndex || '/', frequencyStability: item.frequencyStability || '' })
        break
      case '3':
        // 晶振相对频率偏差
        crystalOscillatorDeviationList.value.push({ ...item, params: '晶振相对频率偏差', gateTimeUnit: 's', technicalIndex: item.technicalIndex || '/', relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '' })
        break
      case '4':
        // 晶振频率复现性
        crystalOscillatorReproducibilityList.value.push({
          ...item,
          params: '晶振频率复现性',
          gateTimeUnit: 's',
          technicalIndex: item.technicalIndex || '/',
          relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '',
          relativeFrequencyDeviationTwo: item.relativeFrequencyDeviationTwo || '',
        })
        break
      case '5':
        // 晶振日老化率
        crystalOscillatorDailyAgingRateList.value.push({
          ...item,
          params: '晶振日老化率',
          gateTimeUnit: 's',
          technicalIndex: item.technicalIndex || '/',
          relativeFrequencyDeviationOne: item.relativeFrequencyDeviationOne || '',
          dailyAgingRateOne: item.dailyAgingRateOne || '',
          correlationCoefficientOne: item.correlationCoefficientOne || '',
        })
        break
      case '6':
        11111111
        // 频率测量范围、输入灵敏度
        if (props.itemCategoryName === '通用计数器') {
          frequencyMeasureRangeList.value.push({
            ...item,
            params: '频率测量范围、输入灵敏度',
            technicalIndex: item.technicalIndex || '/',
            inputSensitivity: item.signalSourceOutputAmplitude || '',
            inputSensitivityUnit: item.signalSourceOutputAmplitudeUnit || '',
            effectiveResolution: item.effectiveResolution || '',
            effectiveResolutionUnit: item.effectiveResolutionUnit || '',
          })
        }
        else {
          frequencyMeasureRangeList.value.push({
            ...item,
            params: '频率测量范围、输入灵敏度及最大输入电平',
            technicalIndex: item.technicalIndex || '/',
            inputSensitivity: item.signalSourceOutputAmplitude + item.signalSourceOutputAmplitudeUnit || '',
            maxInputLevel: item.signalSourceMaxInputLevel || '',
            maxInputLevelUnit: item.signalSourceMaxInputLevelUnit || '',

          })
        }

        break
      case '7':
        // 频率测量误差
        frequencyMeasureErrorList.value.push({
          ...item,
          params: '频率测量误差',
          technicalIndex: item.technicalIndex || '/',
          effectiveResolution: item.effectiveResolution || '',
          effectiveResolutionUnit: item.effectiveResolutionUnit || '',
          testValueOne: item.testValueOne || '',
          testValueTwo: item.testValueTwo || '',
          testValueThree: item.testValueThree || '',
        })
        break
      case '8':
        // 周期测量范围、输入灵敏度
        periodicMeasureRangeList.value.push({
          ...item,
          params: '周期测量范围、输入灵敏度',
          technicalIndex: item.technicalIndex || '/',
          inputSensitivity: item.inputSensitivity || '',
          effectiveResolution: item.effectiveResolution || '',
          effectiveResolutionUnit: item.effectiveResolutionUnit || '',

        })
        break
      case '9':
        // 周期测量误差
        periodicMeasureErrorList.value.push({
          ...item,
          params: '周期测量误差',
          technicalIndex: item.technicalIndex || '/',
          testValueOne: item.testValueOne || '',
          testValueTwo: item.testValueTwo || '',
          testValueThree: item.testValueThree || '',
          effectiveResolution: item.effectiveResolution || '',
          effectiveResolutionUnit: item.effectiveResolutionUnit || '',
        })
        break
      case '10':
        // 时间间隔测量范围及测量误差
        timeIntervalMeasureRangeList.value.push({
          ...item,
          params: '时间间隔测量范围及测量误差',
          technicalIndex: item.technicalIndex || '/',
          testValueOne: item.testValueOne || '',
          testValueTwo: item.testValueTwo || '',
          testValueThree: item.testValueThree || '',
          effectiveResolution: item.effectiveResolution || '',
          effectiveResolutionUnit: item.effectiveResolutionUnit || '',
        })
        break
    }
  })
  // 晶振开机特性 采样组数
  if (crystalOscillatorStartupCharacterList.value.length) {
    const num = crystalOscillatorStartupCharacterList.value.length
    if (num !== Number(crystalOscillatorStartupCharacterList.value[0].sampleGroupNumber)) {
      for (let i = 0; i < (Number(crystalOscillatorStartupCharacterList.value[0].sampleGroupNumber) - num); i++) {
        crystalOscillatorStartupCharacterList.value.push(JSON.parse(JSON.stringify(crystalOscillatorStartupCharacterList.value[0])))
      }
    }
    crystalOscillatorStartupCharacterList.value = crystalOscillatorStartupCharacterList.value.map((item: any, index: number) => ({ ...item, serialNumber: index + 1 }))
  }

  // 晶振日老化率 采样组数
  if (crystalOscillatorDailyAgingRateList.value.length) {
    const num = crystalOscillatorDailyAgingRateList.value.length
    if (num !== Number(crystalOscillatorDailyAgingRateList.value[0].sampleGroupNumber)) {
      for (let i = 0; i < (Number(crystalOscillatorDailyAgingRateList.value[0].sampleGroupNumber) - num); i++) {
        crystalOscillatorDailyAgingRateList.value.push(JSON.parse(JSON.stringify(crystalOscillatorDailyAgingRateList.value[0])))
      }
    }
    crystalOscillatorDailyAgingRateList.value = crystalOscillatorDailyAgingRateList.value.map((item: any, index: number) => ({ ...item, serialNumber: index + 1, dailyAgingRateOne: crystalOscillatorDailyAgingRateList.value[0].dailyAgingRateOne, correlationCoefficientOne: crystalOscillatorDailyAgingRateList.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 === '晶振日老化率' || 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 '晶振开机特性':
      crystalOscillatorStartupCharacterList.value = result || crystalOscillatorStartupCharacterList.value
      break
    case '晶振1s频率稳定度':
      crystalOscillatorStabilityList.value = result || crystalOscillatorStabilityList.value
      break
    case '晶振相对频率偏差':
      crystalOscillatorDeviationList.value = result || crystalOscillatorDeviationList.value
      break
    case '晶振频率复现性':
      crystalOscillatorReproducibilityList.value = result || crystalOscillatorReproducibilityList.value
      break
    case '晶振日老化率':
      crystalOscillatorDailyAgingRateList.value = result || crystalOscillatorDailyAgingRateList.value
      break
    case '频率测量范围、输入灵敏度':
      frequencyMeasureRangeList.value = result || frequencyMeasureRangeList.value
      break
    case '频率测量范围、输入灵敏度及最大输入电平':
      frequencyMeasureRangeList.value = result || frequencyMeasureRangeList.value
      break
    case '频率测量误差':
      frequencyMeasureErrorList.value = result || frequencyMeasureErrorList.value
      break
    case '周期测量范围、输入灵敏度':
      periodicMeasureRangeList.value = result || periodicMeasureRangeList.value
      break
    case '周期测量误差':
      periodicMeasureErrorList.value = result || periodicMeasureErrorList.value
      break
    case '时间间隔测量范围及测量误差':
      timeIntervalMeasureRangeList.value = result || timeIntervalMeasureRangeList.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 })
const resolutionList = ref<{ value: string; name: string; id: string }[]>([]) // 有效分辨力
// 每个table对应的下拉框内容 字典
const tableDict = ref<{ [key: string]: { value: string; name: string; id: string }[] }>({})

const fecthDict = async () => {
  // 有效分辨力单位
  const res1 = await getDictByCode('bizFirstStandardFrequencyUnit')
  resolutionList.value = res1.data

  // table字典
  tableDict.value = {
    有效分辨力单位: resolutionList.value,
  }
}
fecthDict()

// 折线图绘制
// 折线图 x轴 数据
const xAxisData = ref([])
// 折线图y轴数据
const yAxisData = ref([])
const isShowChart = ref(false)
watch(() => crystalOscillatorDailyAgingRateList.value, (newVal) => {
  if (newVal && newVal?.length) {
    // console.log(crystalOscillatorDailyAgingRateList.value, '1111111111111')
    // 判断是否通过验证
    // if (useCheckList(crystalOscillatorDailyAgingRateList.value, columns_crystal_oscillator_dailyAging_rate.value, '晶振日老化率') && String(crystalOscillatorDailyAgingRateList.value[0].dailyAgingRateOne)) {
    isShowChart.value = true
    xAxisData.value = crystalOscillatorDailyAgingRateList.value.map((item: { serialNumber: string | number }) => item.serialNumber) as any[]
    if (Math.abs(crystalOscillatorDailyAgingRateList.value[0].correlationCoefficientOne) >= 0.6) {
      // 两条曲线
      yAxisData.value = [{ name: '相对频率偏差', symbol: 'rect', data: crystalOscillatorDailyAgingRateList.value.map((item: { relativeFrequencyDeviationOne: string | number }) => item.relativeFrequencyDeviationOne), color: '#000080' },
        { name: '日老化率', symbol: 'none', data: crystalOscillatorDailyAgingRateList.value.map((item: { dailyAgingRateOrdinate: string | number }) => item.dailyAgingRateOrdinate), color: '#000000' },
      ] as any
      console.log(yAxisData.value, 'yAxisData.valueyAxisData.value')
    }
    else {
      // 一条曲线
      yAxisData.value = [{ name: '相对频率偏差', symbol: 'rect', data: crystalOscillatorDailyAgingRateList.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" @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-table
          v-if="crystalOscillatorStartupCharacterList.length" title="晶振开机特性"
          :data="crystalOscillatorStartupCharacterList" :columns="columns_crystal_oscillator_startup_character"
          :disabled="pageType === 'detail'" index="1" :show-btn="false" :calc-btn="pageType !== 'detail'"
          :show-title="true" :is-multi="false" :need-merge-cells="['startupCharacter', 'technicalIndex', 'conclusion']"
          @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.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '开机特性V'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 晶振1s频率稳定度 -->
        <template-table
          v-if="crystalOscillatorStabilityList.length" title="晶振1s频率稳定度"
          :data="crystalOscillatorStabilityList" :columns="columns_crystal_oscillator_stability"
          :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.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="crystalOscillatorDeviationList.length" title="晶振相对频率偏差"
          :data="crystalOscillatorDeviationList" :columns="columns_crystal_oscillator_deviation"
          :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.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="crystalOscillatorReproducibilityList.length" title="晶振频率复现性"
          :data="crystalOscillatorReproducibilityList" :columns="columns_crystal_oscillator_reproducibility"
          :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.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === 'T1/T3'">
              <span v-for="item in scope.tOneUnit" :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="crystalOscillatorDailyAgingRateList.length" title="晶振日老化率"
          :data="crystalOscillatorDailyAgingRateList" :columns="columns_crystal_oscillator_dailyAging_rate"
          :disabled="pageType === 'detail'" index="5" :show-btn="false" :calc-btn="pageType !== 'detail'"
          :show-title="true" :is-multi="false" :need-merge-cells="['dailyAgingRateOne', 'correlationCoefficientOne']"
          @calculate-result="calculate"
        >
          <template #next-content="{ scope, column }">
            <template v-if="column.text === '闸门时间'">
              <span v-for="item in scope.gateTimeUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
          </template>
          <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 #custom-content="{ scope, column }">
            {{ scope.row }}
            <template v-if="column.text === '日老化率K(计算值)'">
              <!-- <el-input-number

                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="crystalOscillatorDailyAgingRateList.length && isShowChart" style="width: 100%; height: 360px;">
          <line-chart
            style="width: 80%;margin: 0 auto;" :smooth="false" :gradient="false" :x-axis-data="xAxisData"
            :data="yAxisData"
          />
        </div>

        <!-- 频率测量范围、输入灵敏度 ||  频率测量范围、输入灵敏度及最大输入电平 -->
        <template-table
          v-if="frequencyMeasureRangeList.length"
          :title="props.itemCategoryName === '通用计数器' ? '频率测量范围、输入灵敏度' : '频率测量范围、输入灵敏度及最大输入电平'"
          :data="frequencyMeasureRangeList" :columns="columns_frequency_measure_range" :disabled="pageType === 'detail'"
          index="6" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false"
          :need-merge-cells="['thoroughfare']" :select-all-list="tableDict" @calculate-result="calculate"
        >
          <template #pre-content="{ scope, column }">
            <template v-if="column.text === '输入灵敏度技术指标'">
              <span v-for="item in scope.technicalIndexSymbol" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === 'otherTechnicalIndexSymbol'">
              <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.nominalValueUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === '输入灵敏度'">
              <span
                v-for="item in scope.technicalIndexUnit || scope.inputSensitivityUnit" :key="item"
                style="display: inline-block;"
              >{{ item
              }}</span>
            </template>
            <template v-if="column.text === '最大输入电平'">
              <span
                v-for="item in scope.otherTechnicalIndexUnit || scope.maxInputLevelUnit" :key="item"
                style="display: inline-block;"
              >{{ item
              }}</span>
            </template>
            <template v-if="column.text === '最大输入电平技术指标'">
              <span
                v-for="item in scope.otherTechnicalIndexUnit || scope.maxInputLevelUnit" :key="item"
                style="display: inline-block;"
              >{{ item
              }}</span>
            </template>
            <template v-if="column.text === '输入灵敏度技术指标'">
              <span v-for="item in scope.technicalIndexUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="props.itemCategoryName === '通用计数器'">
              <span
                v-if="(scope.exceedMark === 1 || scope.exceedMark === '1') && column.text === '输入灵敏度'"
                style="display: inline-block; color: red;"
              >*</span>
            </template>
            <template v-if="props.itemCategoryName === '微波计数器'">
              <span
                v-if="(scope.exceedMark === 1 || scope.exceedMark === '1') && column.text === '输入灵敏度'"
                style="display: inline-block; color: red;"
              >*</span>
              <span
                v-if="(scope.exceedMarkOne === 1 || scope.exceedMarkOne === '1') && column.text === '最大输入电平'"
                style="display: inline-block; color: red;"
              >*</span>
            </template>
          </template>
        </template-table>

        <!-- 频率测量误差 -->
        <template-table
          v-if="frequencyMeasureErrorList.length" title="频率测量误差" :data="frequencyMeasureErrorList"
          :columns="columns_frequency_measure_error" :disabled="pageType === 'detail'" index="7" :show-btn="false"
          :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false"
          :need-merge-cells="['thoroughfare', 'nominalValue']" :select-all-list="tableDict"
          @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 === '标称值' || (column.text.includes('测量值') && column.text.length === 4)">
              <span v-for="item in scope.nominalValueUnit" :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 === '测量值误差'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 周期测量范围、输入灵敏度 -->
        <template-table
          v-if="periodicMeasureRangeList.length && props.itemCategoryName === '通用计数器'"
          title="周期测量范围、输入灵敏度" :data="periodicMeasureRangeList" :columns="columns_periodic_measure_range"
          :disabled="pageType === 'detail'" index="8" :show-btn="false" :calc-btn="pageType !== 'detail'"
          :show-title="true" :is-multi="false" :need-merge-cells="['thoroughfare']" :select-all-list="tableDict"
          @calculate-result="calculate"
        >
          <template #pre-content="{ scope, column }">
            <template v-if="column.text === '输入灵敏度技术指标'">
              <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.nominalValueUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <template v-if="column.text === '输入灵敏度'">
              <span v-for="item in scope.technicalIndexUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <template v-if="column.text === '输入灵敏度技术指标'">
              <span v-for="item in scope.technicalIndexUnit" :key="item" style="display: inline-block;">{{ item
              }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '输入灵敏度'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 周期测量误差 -->
        <template-table
          v-if="periodicMeasureErrorList.length && props.itemCategoryName === '通用计数器'" title="周期测量误差"
          :data="periodicMeasureErrorList" :columns="columns_periodic_measure_error" :disabled="pageType === 'detail'"
          index="9" :show-btn="false" :calc-btn="pageType !== 'detail'" :show-title="true" :is-multi="false"
          :need-merge-cells="['thoroughfare']" :select-all-list="tableDict" @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 === '标称值' || (column.text.includes('测量值') && column.text.length === 4)">
              <span v-for="item in scope.nominalValueUnit" :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 === '测量值误差'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>

        <!-- 时间间隔测量范围及测量误差 -->
        <template-table
          v-if="timeIntervalMeasureRangeList.length && props.itemCategoryName === '通用计数器'"
          title="时间间隔测量范围及测量误差" :data="timeIntervalMeasureRangeList" :columns="columns_time_interval_measure_range"
          :disabled="pageType === 'detail'" index="10" :show-btn="false" :calc-btn="pageType !== 'detail'"
          :show-title="true" :is-multi="false" :need-merge-cells="[]" :select-all-list="tableDict"
          @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 === '标称值' || (column.text.includes('测量值') && column.text.length === 4)">
              <span v-for="item in scope.nominalValueUnit" :key="item" style="display: inline-block;">{{ item }}</span>
            </template>
            <span
              v-if="scope.conclusion === '不符合指标' && column.text === '测量值误差'"
              style="display: inline-block; color: red;"
            >*</span>
          </template>
        </template-table>
      </el-form>
      <!-- 历史修改记录 -->
      <change-record v-if="pageType === 'detail' && current === 'change-record'" :info-id="infoId" />

      <!-- ------------------------------------------------结论------------------------------------------------ -->
      <el-form
        v-if="current === 'measure-data'" ref="formRef" :model="itemFormData" label-width="140"
        label-position="right" style="margin-top: 20px;"
      >
        <el-row>
          <el-col :span="12">
            <el-form-item label="备注:" prop="remark">
              <el-input
                v-model="itemFormData.remark" class="full-width-input"
                :placeholder="pageType === 'detail' ? ' ' : '备注'" autosize type="textarea"
                :disabled="pageType === 'detail'"
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </detail-block>
  </div>
</template>

<style lang="scss">
.measure-data-template-detail {
  .el-radio__label {
    display: block !important;
  }
}
</style>