diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateTable.vue b/src/views/business/measure/item/components/tenth/templateTable.vue index 9730d79..b1c9872 100644 --- a/src/views/business/measure/item/components/tenth/templateTable.vue +++ b/src/views/business/measure/item/components/tenth/templateTable.vue @@ -38,22 +38,38 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 - +// ------------------------------------------字典---------------------------------------------- +const standardTechnicalIndexSymbolList = ref([]) // 技术指标规则 +const standardAmplitudeUnitList = ref([]) // 幅度单位 +const standardFrequencyUnitList = ref([]) // 频率单位-公用 +const standard10HarmonicNumberList = ref([]) // 谐波次数 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 技术指标规则 + getDictByCode('standardTechnicalIndexSymbol').then((response) => { + standardTechnicalIndexSymbolList.value = response.data + }) + // 幅度单位 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data + }) + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 谐波次数 + getDictByCode('standard10HarmonicNumber').then((response) => { + standard10HarmonicNumberList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -87,7 +103,7 @@ } // 多选选中结果 -function selectionChange(selection: []) { +function handleSelectionChange(selection: []) { emit('selectionChange', selection) } // 点击行 @@ -103,10 +119,7 @@ initColumnsState() changeColumns() }) -// 多选 -const handleSelectionChange = (val: any) => { - emit('multiSelect', val) -} + // 清除多选选中 const clearMulti = () => { console.log('清理选中') @@ -149,6 +162,173 @@ + diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateTable.vue b/src/views/business/measure/item/components/tenth/templateTable.vue index 9730d79..b1c9872 100644 --- a/src/views/business/measure/item/components/tenth/templateTable.vue +++ b/src/views/business/measure/item/components/tenth/templateTable.vue @@ -38,22 +38,38 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 - +// ------------------------------------------字典---------------------------------------------- +const standardTechnicalIndexSymbolList = ref([]) // 技术指标规则 +const standardAmplitudeUnitList = ref([]) // 幅度单位 +const standardFrequencyUnitList = ref([]) // 频率单位-公用 +const standard10HarmonicNumberList = ref([]) // 谐波次数 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 技术指标规则 + getDictByCode('standardTechnicalIndexSymbol').then((response) => { + standardTechnicalIndexSymbolList.value = response.data + }) + // 幅度单位 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data + }) + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 谐波次数 + getDictByCode('standard10HarmonicNumber').then((response) => { + standard10HarmonicNumberList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -87,7 +103,7 @@ } // 多选选中结果 -function selectionChange(selection: []) { +function handleSelectionChange(selection: []) { emit('selectionChange', selection) } // 点击行 @@ -103,10 +119,7 @@ initColumnsState() changeColumns() }) -// 多选 -const handleSelectionChange = (val: any) => { - emit('multiSelect', val) -} + // 清除多选选中 const clearMulti = () => { console.log('清理选中') @@ -149,6 +162,173 @@ + diff --git a/src/views/business/measure/item/components/thirteenth/templateDetail.vue b/src/views/business/measure/item/components/thirteenth/templateDetail.vue index 52080b9..8b26394 100644 --- a/src/views/business/measure/item/components/thirteenth/templateDetail.vue +++ b/src/views/business/measure/item/components/thirteenth/templateDetail.vue @@ -825,25 +825,25 @@ if (form.value.timeBase) { timeBaseResult = checkList(timeBaseList.value, '时基') } - else if (form.value.currentGain) { + if (form.value.currentGain) { currentGainResult = checkList(zeroFrequencyGainList.value, '直流增益') } - else if (form.value.currentBias) { + if (form.value.currentBias) { currentBiasResult = checkList(DCBiasList.value, '直流偏置') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthList.value, '频带宽度') } - else if (form.value.triggerSensitivity) { + if (form.value.triggerSensitivity) { triggerSensitivityResult = checkList(triggerSensitivityList.value, '触发灵敏度') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeList.value, '上升时间') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceList.value, '输入电阻') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalList.value, '校准信号') } if (timeBaseResult && currentGainResult && currentBiasResult && bandWidthResult && triggerSensitivityResult && riseTimeResult && inputResistanceResult && calibratingSignalResult) { @@ -858,22 +858,22 @@ if (form.value.scanTimeCoefficient) { scanTimeCoefficientResult = checkList(scanningTimeList.value, '扫描时间系数及扩展') } - else if (form.value.verticalAmplitude) { + if (form.value.verticalAmplitude) { verticalAmplitudeResult = checkList(verticalSizeList.value, '垂直幅度') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthSimulateList.value, '频带宽度') } - else if (form.value.triggerCharacter) { + if (form.value.triggerCharacter) { triggerCharacterResult = checkList(triggerCharacteristicList.value, '触发特性') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceSimulateList.value, '输入电阻') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeSimulateList.value, '上升时间') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalSimulateList.value, '校准信号') } if (scanTimeCoefficientResult && verticalAmplitudeResult && bandWidthResult && triggerCharacterResult && inputResistanceResult && riseTimeResult && calibratingSignalResult @@ -1054,18 +1054,20 @@ }) watch(() => props.form, (newValue) => { - form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 - form.value.timeBase = newValue.timeBase // 时基(示波器-数字) - form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) - form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) - form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) - form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) - form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) - form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) - form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) - form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) - form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) - form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.timeBase = newValue.timeBase // 时基(示波器-数字) + form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) + form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) + form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) + form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) + form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) + form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) + form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) + form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) + form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) + form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + } }, { deep: true, immediate: true }) defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateTable.vue b/src/views/business/measure/item/components/tenth/templateTable.vue index 9730d79..b1c9872 100644 --- a/src/views/business/measure/item/components/tenth/templateTable.vue +++ b/src/views/business/measure/item/components/tenth/templateTable.vue @@ -38,22 +38,38 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 - +// ------------------------------------------字典---------------------------------------------- +const standardTechnicalIndexSymbolList = ref([]) // 技术指标规则 +const standardAmplitudeUnitList = ref([]) // 幅度单位 +const standardFrequencyUnitList = ref([]) // 频率单位-公用 +const standard10HarmonicNumberList = ref([]) // 谐波次数 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 技术指标规则 + getDictByCode('standardTechnicalIndexSymbol').then((response) => { + standardTechnicalIndexSymbolList.value = response.data + }) + // 幅度单位 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data + }) + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 谐波次数 + getDictByCode('standard10HarmonicNumber').then((response) => { + standard10HarmonicNumberList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -87,7 +103,7 @@ } // 多选选中结果 -function selectionChange(selection: []) { +function handleSelectionChange(selection: []) { emit('selectionChange', selection) } // 点击行 @@ -103,10 +119,7 @@ initColumnsState() changeColumns() }) -// 多选 -const handleSelectionChange = (val: any) => { - emit('multiSelect', val) -} + // 清除多选选中 const clearMulti = () => { console.log('清理选中') @@ -149,6 +162,173 @@ + diff --git a/src/views/business/measure/item/components/thirteenth/templateDetail.vue b/src/views/business/measure/item/components/thirteenth/templateDetail.vue index 52080b9..8b26394 100644 --- a/src/views/business/measure/item/components/thirteenth/templateDetail.vue +++ b/src/views/business/measure/item/components/thirteenth/templateDetail.vue @@ -825,25 +825,25 @@ if (form.value.timeBase) { timeBaseResult = checkList(timeBaseList.value, '时基') } - else if (form.value.currentGain) { + if (form.value.currentGain) { currentGainResult = checkList(zeroFrequencyGainList.value, '直流增益') } - else if (form.value.currentBias) { + if (form.value.currentBias) { currentBiasResult = checkList(DCBiasList.value, '直流偏置') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthList.value, '频带宽度') } - else if (form.value.triggerSensitivity) { + if (form.value.triggerSensitivity) { triggerSensitivityResult = checkList(triggerSensitivityList.value, '触发灵敏度') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeList.value, '上升时间') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceList.value, '输入电阻') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalList.value, '校准信号') } if (timeBaseResult && currentGainResult && currentBiasResult && bandWidthResult && triggerSensitivityResult && riseTimeResult && inputResistanceResult && calibratingSignalResult) { @@ -858,22 +858,22 @@ if (form.value.scanTimeCoefficient) { scanTimeCoefficientResult = checkList(scanningTimeList.value, '扫描时间系数及扩展') } - else if (form.value.verticalAmplitude) { + if (form.value.verticalAmplitude) { verticalAmplitudeResult = checkList(verticalSizeList.value, '垂直幅度') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthSimulateList.value, '频带宽度') } - else if (form.value.triggerCharacter) { + if (form.value.triggerCharacter) { triggerCharacterResult = checkList(triggerCharacteristicList.value, '触发特性') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceSimulateList.value, '输入电阻') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeSimulateList.value, '上升时间') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalSimulateList.value, '校准信号') } if (scanTimeCoefficientResult && verticalAmplitudeResult && bandWidthResult && triggerCharacterResult && inputResistanceResult && riseTimeResult && calibratingSignalResult @@ -1054,18 +1054,20 @@ }) watch(() => props.form, (newValue) => { - form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 - form.value.timeBase = newValue.timeBase // 时基(示波器-数字) - form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) - form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) - form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) - form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) - form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) - form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) - form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) - form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) - form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) - form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.timeBase = newValue.timeBase // 时基(示波器-数字) + form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) + form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) + form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) + form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) + form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) + form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) + form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) + form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) + form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) + form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + } }, { deep: true, immediate: true }) defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/thirteenth/templateTable.vue b/src/views/business/measure/item/components/thirteenth/templateTable.vue index 7dbaee8..1ff1a29 100644 --- a/src/views/business/measure/item/components/thirteenth/templateTable.vue +++ b/src/views/business/measure/item/components/thirteenth/templateTable.vue @@ -107,10 +107,6 @@ getDictByCode('standardAmplitudeUnit').then((response) => { standardAmplitudeUnitList.value = response.data }) - // 幅度单位 - getDictByCode('standardAmplitudeUnit').then((response) => { - standardAmplitudeUnitList.value = response.data - }) // 校准信号--项目 getDictByCode('standard13Item').then((response) => { standard13ItemList.value = response.data diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateTable.vue b/src/views/business/measure/item/components/tenth/templateTable.vue index 9730d79..b1c9872 100644 --- a/src/views/business/measure/item/components/tenth/templateTable.vue +++ b/src/views/business/measure/item/components/tenth/templateTable.vue @@ -38,22 +38,38 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 - +// ------------------------------------------字典---------------------------------------------- +const standardTechnicalIndexSymbolList = ref([]) // 技术指标规则 +const standardAmplitudeUnitList = ref([]) // 幅度单位 +const standardFrequencyUnitList = ref([]) // 频率单位-公用 +const standard10HarmonicNumberList = ref([]) // 谐波次数 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 技术指标规则 + getDictByCode('standardTechnicalIndexSymbol').then((response) => { + standardTechnicalIndexSymbolList.value = response.data + }) + // 幅度单位 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data + }) + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 谐波次数 + getDictByCode('standard10HarmonicNumber').then((response) => { + standard10HarmonicNumberList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -87,7 +103,7 @@ } // 多选选中结果 -function selectionChange(selection: []) { +function handleSelectionChange(selection: []) { emit('selectionChange', selection) } // 点击行 @@ -103,10 +119,7 @@ initColumnsState() changeColumns() }) -// 多选 -const handleSelectionChange = (val: any) => { - emit('multiSelect', val) -} + // 清除多选选中 const clearMulti = () => { console.log('清理选中') @@ -149,6 +162,173 @@ + diff --git a/src/views/business/measure/item/components/thirteenth/templateDetail.vue b/src/views/business/measure/item/components/thirteenth/templateDetail.vue index 52080b9..8b26394 100644 --- a/src/views/business/measure/item/components/thirteenth/templateDetail.vue +++ b/src/views/business/measure/item/components/thirteenth/templateDetail.vue @@ -825,25 +825,25 @@ if (form.value.timeBase) { timeBaseResult = checkList(timeBaseList.value, '时基') } - else if (form.value.currentGain) { + if (form.value.currentGain) { currentGainResult = checkList(zeroFrequencyGainList.value, '直流增益') } - else if (form.value.currentBias) { + if (form.value.currentBias) { currentBiasResult = checkList(DCBiasList.value, '直流偏置') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthList.value, '频带宽度') } - else if (form.value.triggerSensitivity) { + if (form.value.triggerSensitivity) { triggerSensitivityResult = checkList(triggerSensitivityList.value, '触发灵敏度') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeList.value, '上升时间') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceList.value, '输入电阻') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalList.value, '校准信号') } if (timeBaseResult && currentGainResult && currentBiasResult && bandWidthResult && triggerSensitivityResult && riseTimeResult && inputResistanceResult && calibratingSignalResult) { @@ -858,22 +858,22 @@ if (form.value.scanTimeCoefficient) { scanTimeCoefficientResult = checkList(scanningTimeList.value, '扫描时间系数及扩展') } - else if (form.value.verticalAmplitude) { + if (form.value.verticalAmplitude) { verticalAmplitudeResult = checkList(verticalSizeList.value, '垂直幅度') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthSimulateList.value, '频带宽度') } - else if (form.value.triggerCharacter) { + if (form.value.triggerCharacter) { triggerCharacterResult = checkList(triggerCharacteristicList.value, '触发特性') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceSimulateList.value, '输入电阻') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeSimulateList.value, '上升时间') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalSimulateList.value, '校准信号') } if (scanTimeCoefficientResult && verticalAmplitudeResult && bandWidthResult && triggerCharacterResult && inputResistanceResult && riseTimeResult && calibratingSignalResult @@ -1054,18 +1054,20 @@ }) watch(() => props.form, (newValue) => { - form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 - form.value.timeBase = newValue.timeBase // 时基(示波器-数字) - form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) - form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) - form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) - form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) - form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) - form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) - form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) - form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) - form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) - form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.timeBase = newValue.timeBase // 时基(示波器-数字) + form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) + form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) + form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) + form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) + form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) + form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) + form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) + form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) + form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) + form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + } }, { deep: true, immediate: true }) defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/thirteenth/templateTable.vue b/src/views/business/measure/item/components/thirteenth/templateTable.vue index 7dbaee8..1ff1a29 100644 --- a/src/views/business/measure/item/components/thirteenth/templateTable.vue +++ b/src/views/business/measure/item/components/thirteenth/templateTable.vue @@ -107,10 +107,6 @@ getDictByCode('standardAmplitudeUnit').then((response) => { standardAmplitudeUnitList.value = response.data }) - // 幅度单位 - getDictByCode('standardAmplitudeUnit').then((response) => { - standardAmplitudeUnitList.value = response.data - }) // 校准信号--项目 getDictByCode('standard13Item').then((response) => { standard13ItemList.value = response.data diff --git a/src/views/business/measure/item/detail.vue b/src/views/business/measure/item/detail.vue index a03eedf..16a5eb1 100644 --- a/src/views/business/measure/item/detail.vue +++ b/src/views/business/measure/item/detail.vue @@ -359,6 +359,17 @@ })), // 鉴定项列表 } } + else if (form.value.belongStandardEquipment === '10') { // 第10套:信号发生器 + if (!standardRef.value.checkListBeforeSave()) { params = '未通过校验'; return params } + const list = standardRef.value.solveDataBeforeSave() // 处理数据 + params = { + helpFieldInstruction: form.value.helpFieldInstruction, // 辅助字段说明 + itemRemark: form.value.itemRemark, // 检定项备注 + itemId: infoId.value, // 检定项id + measureItemDataSignalGeneratorList: list, + ...standardRef.value.form, + } + } else if (form.value.belongStandardEquipment === '13') { // 第13套:示波器 if (!standardRef.value.checkListBeforeSave()) { params = '未通过校验'; return params } const list = standardRef.value.solveDataBeforeSave() // 处理数据 @@ -553,6 +564,10 @@ getList.value = response.measureItemDataSpectrumAnalyzerList // 检定项表格 getObject.value = response // 检定项表单 } + else if (form.value.belongStandardEquipment === '10') { // 第10套:信号发生器 + getList.value = response.measureItemDataSignalGeneratorList // 检定项表格 + getObject.value = response // 检定项表单 + } else if (form.value.belongStandardEquipment === '13') { // 第13套:示波器 getList.value = response.measureItemDataOscilloscopeList // 检定项表格 getObject.value = response // 检定项表单 diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateTable.vue b/src/views/business/measure/item/components/tenth/templateTable.vue index 9730d79..b1c9872 100644 --- a/src/views/business/measure/item/components/tenth/templateTable.vue +++ b/src/views/business/measure/item/components/tenth/templateTable.vue @@ -38,22 +38,38 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 - +// ------------------------------------------字典---------------------------------------------- +const standardTechnicalIndexSymbolList = ref([]) // 技术指标规则 +const standardAmplitudeUnitList = ref([]) // 幅度单位 +const standardFrequencyUnitList = ref([]) // 频率单位-公用 +const standard10HarmonicNumberList = ref([]) // 谐波次数 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 技术指标规则 + getDictByCode('standardTechnicalIndexSymbol').then((response) => { + standardTechnicalIndexSymbolList.value = response.data + }) + // 幅度单位 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data + }) + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 谐波次数 + getDictByCode('standard10HarmonicNumber').then((response) => { + standard10HarmonicNumberList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -87,7 +103,7 @@ } // 多选选中结果 -function selectionChange(selection: []) { +function handleSelectionChange(selection: []) { emit('selectionChange', selection) } // 点击行 @@ -103,10 +119,7 @@ initColumnsState() changeColumns() }) -// 多选 -const handleSelectionChange = (val: any) => { - emit('multiSelect', val) -} + // 清除多选选中 const clearMulti = () => { console.log('清理选中') @@ -149,6 +162,173 @@ + diff --git a/src/views/business/measure/item/components/thirteenth/templateDetail.vue b/src/views/business/measure/item/components/thirteenth/templateDetail.vue index 52080b9..8b26394 100644 --- a/src/views/business/measure/item/components/thirteenth/templateDetail.vue +++ b/src/views/business/measure/item/components/thirteenth/templateDetail.vue @@ -825,25 +825,25 @@ if (form.value.timeBase) { timeBaseResult = checkList(timeBaseList.value, '时基') } - else if (form.value.currentGain) { + if (form.value.currentGain) { currentGainResult = checkList(zeroFrequencyGainList.value, '直流增益') } - else if (form.value.currentBias) { + if (form.value.currentBias) { currentBiasResult = checkList(DCBiasList.value, '直流偏置') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthList.value, '频带宽度') } - else if (form.value.triggerSensitivity) { + if (form.value.triggerSensitivity) { triggerSensitivityResult = checkList(triggerSensitivityList.value, '触发灵敏度') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeList.value, '上升时间') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceList.value, '输入电阻') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalList.value, '校准信号') } if (timeBaseResult && currentGainResult && currentBiasResult && bandWidthResult && triggerSensitivityResult && riseTimeResult && inputResistanceResult && calibratingSignalResult) { @@ -858,22 +858,22 @@ if (form.value.scanTimeCoefficient) { scanTimeCoefficientResult = checkList(scanningTimeList.value, '扫描时间系数及扩展') } - else if (form.value.verticalAmplitude) { + if (form.value.verticalAmplitude) { verticalAmplitudeResult = checkList(verticalSizeList.value, '垂直幅度') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthSimulateList.value, '频带宽度') } - else if (form.value.triggerCharacter) { + if (form.value.triggerCharacter) { triggerCharacterResult = checkList(triggerCharacteristicList.value, '触发特性') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceSimulateList.value, '输入电阻') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeSimulateList.value, '上升时间') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalSimulateList.value, '校准信号') } if (scanTimeCoefficientResult && verticalAmplitudeResult && bandWidthResult && triggerCharacterResult && inputResistanceResult && riseTimeResult && calibratingSignalResult @@ -1054,18 +1054,20 @@ }) watch(() => props.form, (newValue) => { - form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 - form.value.timeBase = newValue.timeBase // 时基(示波器-数字) - form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) - form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) - form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) - form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) - form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) - form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) - form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) - form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) - form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) - form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.timeBase = newValue.timeBase // 时基(示波器-数字) + form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) + form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) + form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) + form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) + form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) + form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) + form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) + form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) + form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) + form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + } }, { deep: true, immediate: true }) defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/thirteenth/templateTable.vue b/src/views/business/measure/item/components/thirteenth/templateTable.vue index 7dbaee8..1ff1a29 100644 --- a/src/views/business/measure/item/components/thirteenth/templateTable.vue +++ b/src/views/business/measure/item/components/thirteenth/templateTable.vue @@ -107,10 +107,6 @@ getDictByCode('standardAmplitudeUnit').then((response) => { standardAmplitudeUnitList.value = response.data }) - // 幅度单位 - getDictByCode('standardAmplitudeUnit').then((response) => { - standardAmplitudeUnitList.value = response.data - }) // 校准信号--项目 getDictByCode('standard13Item').then((response) => { standard13ItemList.value = response.data diff --git a/src/views/business/measure/item/detail.vue b/src/views/business/measure/item/detail.vue index a03eedf..16a5eb1 100644 --- a/src/views/business/measure/item/detail.vue +++ b/src/views/business/measure/item/detail.vue @@ -359,6 +359,17 @@ })), // 鉴定项列表 } } + else if (form.value.belongStandardEquipment === '10') { // 第10套:信号发生器 + if (!standardRef.value.checkListBeforeSave()) { params = '未通过校验'; return params } + const list = standardRef.value.solveDataBeforeSave() // 处理数据 + params = { + helpFieldInstruction: form.value.helpFieldInstruction, // 辅助字段说明 + itemRemark: form.value.itemRemark, // 检定项备注 + itemId: infoId.value, // 检定项id + measureItemDataSignalGeneratorList: list, + ...standardRef.value.form, + } + } else if (form.value.belongStandardEquipment === '13') { // 第13套:示波器 if (!standardRef.value.checkListBeforeSave()) { params = '未通过校验'; return params } const list = standardRef.value.solveDataBeforeSave() // 处理数据 @@ -553,6 +564,10 @@ getList.value = response.measureItemDataSpectrumAnalyzerList // 检定项表格 getObject.value = response // 检定项表单 } + else if (form.value.belongStandardEquipment === '10') { // 第10套:信号发生器 + getList.value = response.measureItemDataSignalGeneratorList // 检定项表格 + getObject.value = response // 检定项表单 + } else if (form.value.belongStandardEquipment === '13') { // 第13套:示波器 getList.value = response.measureItemDataOscilloscopeList // 检定项表格 getObject.value = response // 检定项表单 diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f34605c..13878a2 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -77,9 +77,9 @@ const columns_repeatability_voltage_flatness = ref([ // 重复性表头--稳幅正弦信号电压平坦度 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '类型', value: 'typeValue', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'text' }, - { text: '测量值单位', value: 'testValueUnit', align: 'center', required: true, type: 'text' }, - { text: '转换为电压值单位', value: 'convertVoltageUnit', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { text: '测量值单位', value: 'testValueUnit', width: '100', align: 'center', required: true, type: 'select', options: [{ text: 'kW', value: 'kW' }, { text: 'W', value: 'W' }, { text: 'mW', value: 'mW' }, { text: 'μW', value: 'μW' }] }, + { text: '转换为电压值单位', value: 'convertVoltageUnit', width: '100', align: 'center', required: true, type: 'select', options: [{ text: 'kV', value: 'kV' }, { text: 'V', value: 'V' }, { text: 'mV', value: 'mV' }, { text: 'μV', value: 'μV' }] }, { text: 'X1', value: '-', @@ -88,8 +88,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageOne', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessOne', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -100,8 +100,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageTwo', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessTwo', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -112,8 +112,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageThree', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessThree', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -124,8 +124,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageFour', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessFour', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -136,8 +136,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageFive', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessFive', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -148,8 +148,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageSix', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessSix', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -160,8 +160,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageSeven', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessSeven', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -172,8 +172,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageEight', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessEight', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -184,8 +184,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageNine', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessNine', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -196,8 +196,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageTen', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: false, width: '180', type: 'text' }, ], }, { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, @@ -210,7 +210,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -710,6 +710,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 方波电压(50Ω)稳定性 @@ -750,6 +760,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 方波电压(1MΩ)稳定性 @@ -790,6 +810,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 直流电压(50Ω)稳定性 @@ -830,6 +860,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 直流电压(1MΩ)稳定性 @@ -870,6 +910,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 输入阻抗稳定性 @@ -896,6 +946,11 @@ listVoltageFlatnessRepeatability.value = list.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度重复性 listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + let tempCheckPoint = e.checkPoint + e.unit + if (`${e.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } + return { editable: type === 'edit', dataId: e.id, // 核查数据管理基础信息表id @@ -907,7 +962,8 @@ convertVoltageUnit: 'V', // 转换为电压值单位 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: tempCheckPoint, // 核查点 + referencePoint: e.referencePoint, // 是否为参考点 flatnessOne: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度1/% flatnessTwo: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度2/% flatnessThree: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度3/% @@ -920,6 +976,16 @@ flatnessTen: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度10/% averageValue: '', // 平均值 standardDeviation: '', // 重复性 + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 稳幅正弦信号电压平坦度稳定性 @@ -932,6 +998,7 @@ checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', averageValue: '', // 平均值 stability: '', // 稳定性 @@ -979,11 +1046,12 @@ manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 - testValueOne: '', // 测量值 + testValueOne: e.testValueOne, // 测量值 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 conclusion: '', // 结论 + technicalIndexDefineFront: e.technicalIndexSymbol + e.technicalIndex + e.technicalIndexUnit, } }) } @@ -991,99 +1059,80 @@ // 点击计算结果 const createResult = (type: string) => { let checkDataOscilloscopeListParams: any // 要传的重复或者稳定性参数 - if (current.value === 'stability') { // 计算稳定性 - switch (type) { - case '时标': - if (!listTimeMarkRepeatability.value.length) { - ElMessage.warning('时标 未配置重复性,请检查') - return false - } - if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listTimeMarkStability.value - break - case '方波电压(50Ω)': - if (!listSquareWaveVoltage50ΩRepeatability.value.length) { - ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') - return false - } - if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value - break - case '方波电压(1MΩ)': - if (!listSquareWaveVoltage1MΩRepeatability.value.length) { - ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') - return false - } - if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value - break - case '直流电压(50Ω)': - if (!listDirectVoltage50ΩRepeatability.value.length) { - ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') - return false - } - if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value - break - case '直流电压(1MΩ)': - if (!listDirectVoltage1MΩRepeatability.value.length) { - ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') - return false - } - if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value - break - case '输入阻抗': - if (!listInputImpedanceRepeatability.value.length) { - ElMessage.warning('输入阻抗 未配置重复性,请检查') - return false - } - if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listInputImpedanceStability.value - break - case '稳幅正弦信号电压平坦度': - if (!listVoltageFlatnessRepeatability.value.length) { - ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') - return false - } - if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listVoltageFlatnessStability.value - break - case '上升时间': - if (!listRisetimeRepeatability.value.length) { - ElMessage.warning('上升时间 未配置重复性,请检查') - return false - } - if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listRisetimeStability.value - break - default: - break - } + if (current.value === 'stability') { // 计算稳定性先校验重复性 + if (!checkList()) { return false } + // if (!listTimeMarkRepeatability.value.length) { + // ElMessage.warning('时标 未配置重复性,请检查') + // return false + // } + // if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 时标 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listTimeMarkStability.value + // if (!listSquareWaveVoltage50ΩRepeatability.value.length) { + // ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') + // return false + // } + // if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 方波电压(50Ω) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value + // if (!listSquareWaveVoltage1MΩRepeatability.value.length) { + // ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') + // return false + // } + // if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 方波电压(1MΩ) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value + // if (!listDirectVoltage50ΩRepeatability.value.length) { + // ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') + // return false + // } + // if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 直流电压(50Ω) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value + // if (!listDirectVoltage1MΩRepeatability.value.length) { + // ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') + // return false + // } + // if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 直流电压(1MΩ) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value + // if (!listInputImpedanceRepeatability.value.length) { + // ElMessage.warning('输入阻抗 未配置重复性,请检查') + // return false + // } + // if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 输入阻抗 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listInputImpedanceStability.value + // if (!listVoltageFlatnessRepeatability.value.length) { + // ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') + // return false + // } + // if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 稳幅正弦信号电压平坦度 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listVoltageFlatnessStability.value + // if (!listRisetimeRepeatability.value.length) { + // ElMessage.warning('上升时间 未配置重复性,请检查') + // return false + // } + // if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 上升时间 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listRisetimeStability.value } if (current.value === 'repeatability') { @@ -1759,6 +1808,11 @@ currentDate.value = date } +// 上升时间测量值变化 +const changeTestValueOne = (val: number, index: number) => { + listRisetimeStability.value[index].testValueOne = listRisetimeRepeatability.value[index].testValueOne +} + // -------------------------------------钩子----------------------------------------------------- // 统计日期 const dateCount = (columns: TableColumn[]) => { @@ -1829,15 +1883,6 @@ }) }, { immediate: true }) -watch(() => current.value, (value) => { - console.log('重复性') - console.log(listTimeMarkRepeatability.value) - console.log('稳定性') - console.log(listTimeMarkStability.value) - listTimeMarkRepeatability.value = [...listTimeMarkRepeatability.value] - listTimeMarkStability.value = [...listTimeMarkStability.value] -}) - onMounted(async () => { belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置 itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id @@ -1846,7 +1891,7 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail }) +defineExpose({ fetchCheckItemDetail, checkList }) diff --git a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts index 82f5ae6..a6d4d3f 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail-interface.ts +++ b/src/views/business/measure/item/components/tenth/templateDetail-interface.ts @@ -1,3 +1,37 @@ export interface IList { id: string + itemId: string // 检定项id + dataType: string // 检定项数据类型(一个检定项中区分两个表格)(字典code) + params: string // 检定项目 + nominalValue?: string // 标称值 + unit?: string // 标称值单位 + amplitude?: string // 幅度 + amplitudeUnit?: string // 幅度单位 + urel?: string // U(k=2) + + upperIndex?: string // 指标上限/THD上限 + upperIndexSymbol?: string // 指标上限符号/THD上限符号 + upperIndexUnit?: string // 指标上限单位/THD上限单位 + technicalIndex?: string // 技术指标 + technicalIndexSymbol?: string // 技术指标符号 + technicalIndexUnit?: string // 技术指标单位 + + frequency?: string // 频率 + frequencyUnit?: string // 频率单位 + highPassFilter?: string // 高通滤波 + highPassFilterUnit?: string // 高通滤波单位 + lowerPassFilter?: string // 低通滤波 + lowerPassFilterUnit?: string // 低通滤波单位 + modulationRate?: string // 调制速率 + modulationRateUnit?: string // 调制速率单位 + + harmonicNumber?: string // 谐波次数 + offsetFrequency?: string // 偏移频率 + offsetFrequencyUnit?: string // 偏移频率单位 + power?: string // 功率 + powerUnit?: string // 功率单位 + rbwValue?: string // RBW + rbwValueUnit?: string // RBW单位 + vbwValue?: string // VBW + vbwValueUnit?: string // VBW单位 } diff --git a/src/views/business/measure/item/components/tenth/templateDetail.vue b/src/views/business/measure/item/components/tenth/templateDetail.vue index 8fd5abf..97ca93d 100644 --- a/src/views/business/measure/item/components/tenth/templateDetail.vue +++ b/src/views/business/measure/item/components/tenth/templateDetail.vue @@ -9,6 +9,7 @@ import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import type { TableColumn } from '@/components/NormalTable/table_interface' +import { differenceArray } from '@/utils/Array' const props = defineProps({ pageType: { @@ -34,6 +35,20 @@ default: '', }, }) + +const form = ref({ + appearanceFunctionCheck: 1, // 外观及功能性检查 + frequency: 1, // 频率 + power: 1, // 功率 + amplitudeModulationDepth: 1, // 调幅深度 + frequencyModulationDeviation: 1, // 调频频偏 + remainAmplitudeModulation: 1, // 剩余调幅 + remainFrequencyModulation: 1, // 剩余调频 + harmonic: 1, // 谐波 + phaseModulationPhaseDeviation: 1, // 调相相偏 + noHarmonic: 1, // 非谐波 +}) + const tableLoading = ref(false) const frequencyList = ref([]) // 频率 const powerList = ref([]) // 功率 @@ -43,6 +58,7 @@ const residentialFrequencyModulationList = ref([]) // 剩余调频 const harmonicList = ref([]) // 谐波 const phaseList = ref([]) // 调相相偏 +const noHarmonicList = ref([]) // 非谐波 const frequencyCheckoutList = ref([]) // 频率 const powerCheckoutList = ref([]) // 功率 @@ -52,70 +68,91 @@ const residentialFrequencyModulationCheckoutList = ref([]) // 剩余调频 const harmonicCheckoutList = ref([]) // 谐波 const phaseCheckoutList = ref([]) // 调相相偏 +const noHarmonicheckoutList = ref([]) // 谐波 // ----------------------------------------表头------------------------------------------------ const columns_frequency = ref([ // 频率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, ]) const columns_power = ref([ // 功率 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'minimumAllowFactorA', align: 'center', required: true }, - { text: '标称值单位', value: 'maximumAllowFactorB', align: 'center', required: true }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_amplitude_modulation_depth = ref([ // 调幅深度\调频频偏\调相相偏 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '标称值', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '标称值单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '调制速率单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '技术指标', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'THD上限', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, width: '180' }, + { text: '标称值单位', value: 'unit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '调制速率', value: 'modulationRate', align: 'center', required: true, width: '180' }, + { text: '调制速率单位', value: 'modulationRateUnit', align: 'center', required: true, width: '100' }, + { text: '技术指标', value: 'technicalIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, + { text: 'THD上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, ]) const columns_residential_amplitude_modulation = ref([ // 剩余调幅\剩余调频 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '幅度单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '高通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '低通滤波单位', value: 'maximumAllowValue', align: 'center', required: false }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '高通滤波', value: 'highPassFilter', align: 'center', required: true, width: '180' }, + { text: '高通滤波单位', value: 'highPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '低通滤波', value: 'lowerPassFilter', align: 'center', required: true, width: '180' }, + { text: '低通滤波单位', value: 'lowerPassFilterUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) const columns_harmonic = ref([ // 谐波 { text: '检定项目', value: 'params', align: 'center', required: true }, - { text: '频率', value: 'nominalValue', align: 'center', required: true }, - { text: '频率单位', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度', value: 'nominalValue', align: 'center', required: true }, - { text: '幅度单位', value: 'nominalValue', align: 'center', required: true }, - { text: '指标上限', value: 'maximumAllowValue', align: 'center', required: false }, - { text: 'U(k=2)', value: 'maximumAllowValue', align: 'center', required: false }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '幅度', value: 'amplitude', align: 'center', required: true, width: '180' }, + { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, width: '100' }, + { text: '谐波次数', value: 'harmonicNumber', align: 'center', required: true, width: '180' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, +]) + +const columns_noHarmonic = ref([ // 非谐波 + { text: '检定项目', value: 'params', align: 'center', required: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, width: '180' }, + { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, width: '100' }, + { text: '功率', value: 'power', align: 'center', required: true, width: '180' }, + { text: '功率单位', value: 'powerUnit', align: 'center', required: true, width: '100' }, + { text: '偏移频率', value: 'offsetFrequency', align: 'center', required: true, width: '180' }, + { text: '偏移频率单位', value: 'offsetFrequencyUnit', align: 'center', required: true, width: '100' }, + { text: 'RBW', value: 'rbwValue', align: 'center', required: true, width: '180' }, + { text: 'RBW单位', value: 'rbwValueUnit', align: 'center', required: true, width: '100' }, + { text: 'VBW', value: 'vbwValue', align: 'center', required: true, width: '180' }, + { text: 'VBW单位', value: 'vbwValueUnit', align: 'center', required: true, width: '100' }, + { text: '指标上限', value: 'upperIndex', align: 'center', required: true, width: '340' }, + { text: 'U(k=2)', value: 'urel', align: 'center', required: true, width: '180' }, ]) // --------------------------------表格操作--------------------------------------------------- @@ -146,6 +183,9 @@ case '调相相偏': phaseCheckoutList.value = e break + case '非谐波': + noHarmonicheckoutList.value = e + break } } @@ -155,228 +195,630 @@ * @param title 操作的表格 */ const addRow = (list: IList[], title: string) => { - // if (checkList(list, `${title}表格`)) { - // if (list.length) { // 增加行时默认上一行数据 - // list.push({ - // id: '', - // checkPoint: list[list.length - 1].checkPoint, // 核查点(直接存字典value) - // checkType: list[list.length - 1].checkType, // 核查类型 - // cycleNumber: list[list.length - 1].cycleNumber, // 循环次数 - // equipmentId: list[list.length - 1].equipmentId, // 配套设备id - // itemCategoryId: list[list.length - 1].itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: list[list.length - 1].params, // 核查项目(直接存字典value) - // remark: list[list.length - 1].remark, // 核查项备注(每个数据存储的核查项备注相同,前端取列表中一个即可) - // resolution: list[list.length - 1].resolution, // 分辨力 - // testType: list[list.length - 1].testType, // 核查点类型(直接存字典value) - // unit: list[list.length - 1].unit, // 单位(直接存字典value) - // urel: list[list.length - 1].urel, // 测量标准相对扩展不确定度urel - // }) - // } - // else { - // list.push({ - // checkPoint: '', // 核查点 - // checkType: '', // 核查类型(直接存字典value,多个逗号分隔) - // cycleNumber: 6, // 循环次数 - // equipmentId: infoId.value, // 配套设备id - // itemCategoryId: form.value.itemCategoryId, // 核查项分类id(能够确定是哪个标准装置) - // params: '', // 核查项目(直接存字典value) - // remark: '', // 核查项备注 - // resolution: 0.0001, // 分辨力 - // testType: title, // 核查点类型(直接存字典value) - // unit: '', // 单位(直接存字典value) - // urel: 0, // 测量标准相对扩展不确定度urel - // }) - // } - // } + if (checkList(list, `${title}表格`)) { + if (list.length) { // 增加行时默认上一行数据 + list.push({ ...list[list.length - 1] }) + } + else { + switch (title) { + case '频率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '1', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + }) + break + case '功率': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '2', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'dBm', // 标称值单位 + urel: '', // U(k=2) + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'dB', // 技术指标单位 + }) + break + case '调幅深度': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '3', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: '%', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: '%', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '调频频偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '4', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + nominalValue: '', // 标称值 + unit: 'Hz', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'Hz', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调幅': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '5', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '剩余调频': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '6', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'Hz', // 指标上限单位/THD上限单位 + }) + break + case '谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '7', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: '', // 频率单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + harmonicNumber: '', // 谐波次数 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + case '调相相偏': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '8', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'MHz', // 频率单位 + nominalValue: '', // 标称值 + unit: 'rad', // 标称值单位 + amplitude: '', // 幅度 + amplitudeUnit: 'dBm', // 幅度单位 + highPassFilter: '50', // 高通滤波 + highPassFilterUnit: 'Hz', // 高通滤波单位 + lowerPassFilter: '3', // 低通滤波 + lowerPassFilterUnit: 'kHz', // 低通滤波单位 + modulationRate: '', // 调制速率 + modulationRateUnit: 'Hz', // 调制速率单位 + technicalIndex: '', // 技术指标 + technicalIndexSymbol: '±', // 技术指标前符号 + technicalIndexUnit: 'rad', // 技术指标单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: '%', // 指标上限单位/THD上限单位 + }) + break + case '非谐波': + list.push({ + id: '', // id,更新/删除使用参数 + dataType: '9', // 检定项数据类型(一个检定项中区分两个表格)(字典code) + itemId: props.itemId, // 检定项id + params: title, // 检定项目 + frequency: '', // 频率 + frequencyUnit: 'Hz', // 频率单位 + power: '', // 功率 + powerUnit: 'dBm', // 功率单位 + offsetFrequency: '', // 偏移频率 + offsetFrequencyUnit: 'Hz', // 偏移频率单位 + rbwValue: '1', // RBW + rbwValueUnit: 'kHz', // RBW单位 + vbwValue: '1', // VBW + vbwValueUnit: 'kHz', // VBW单位 + urel: '', // U(k=2) + upperIndex: '', // 指标上限/THD上限 + upperIndexSymbol: '≤', // 指标上限符号/THD上限符号 + upperIndexUnit: 'dBc', // 指标上限单位/THD上限单位 + }) + break + } + } + } } /** * 删除行公共方法 * @param checkoutList 选中的数组 * @param list 操作的数组 */ -const delRow = (checkoutList: IList[], list: IList[]) => { +const delRow = (checkoutList: IList[], list: IList[], title: string) => { if (!checkoutList.length) { ElMessage.warning('请选中要删除的行') } else { - list = list.filter((item: any) => { - return !checkoutList.includes(item) - }) + let data = [] as any[] + data = differenceArray(list, checkoutList) + switch (title) { + case '频率': + frequencyList.value = data + break + case '功率': + powerList.value = data + break + case '调幅深度': + amplitudeModulationDepthList.value = data + break + case '调频频偏': + frequencyModulationDeviationList.value = data + break + case '剩余调幅': + residentialAmplitudeModulationList.value = data + break + case '剩余调频': + residentialFrequencyModulationList.value = data + break + case '谐波': + harmonicList.value = data + break + case '调相相偏': + phaseList.value = data + break + case '非谐波': + noHarmonicList.value = data + break + } } } // ---------------------------------------------校验--------------------------------------------------- -// 校验表格(点击保存的时候用、生成标准器示值) -const checkList = () => { - // return useCheckList(list.value, columns.value, '检定项表格') +// 增加行校验表格 +function checkList(list: any, getTitle: string) { + let title = '' + if (getTitle.slice(getTitle.length - 2) === '表格') { + title = getTitle.slice(0, getTitle.length - 2) + } + else { + title = getTitle + } + let columns + switch (title) { + case '频率': + columns = columns_frequency.value + break + case '功率': + columns = columns_power.value + break + case '调幅深度': + columns = columns_amplitude_modulation_depth.value + break + case '调频频偏': + columns = columns_amplitude_modulation_depth.value + break + case '剩余调幅': + columns = columns_residential_amplitude_modulation.value + break + case '剩余调频': + columns = columns_residential_amplitude_modulation.value + break + case '谐波': + columns = columns_harmonic.value + break + case '调相相偏': + columns = columns_amplitude_modulation_depth.value + break + case '非谐波': + columns = columns_noHarmonic.value + break + } + + return useCheckList(list, columns, `${title}表格`) +} +// 保存之前校验 +const checkListBeforeSave = () => { + // 验空 + if (form.value.frequency && !frequencyList.value.length) { // 频率 + ElMessage.warning('频率 不能为空') + return false + } + else if (form.value.power && !powerList.value.length) { // 功率 + ElMessage.warning('功率 不能为空') + return false + } + else if (form.value.amplitudeModulationDepth && !amplitudeModulationDepthList.value.length) { // 调幅深度 + ElMessage.warning('调幅深度 不能为空') + return false + } + else if (form.value.frequencyModulationDeviation && !frequencyModulationDeviationList.value.length) { // 调频频偏 + ElMessage.warning('调频频偏 不能为空') + return false + } + else if (form.value.remainAmplitudeModulation && !residentialAmplitudeModulationList.value.length) { // 剩余调幅 + ElMessage.warning('剩余调幅 不能为空') + return false + } + else if (form.value.remainFrequencyModulation && !residentialFrequencyModulationList.value.length) { // 剩余调频 + ElMessage.warning('剩余调频 不能为空') + return false + } + else if (form.value.harmonic && !harmonicList.value.length) { // 谐波 + ElMessage.warning('谐波 不能为空') + return false + } + else if (form.value.phaseModulationPhaseDeviation && !phaseList.value.length) { // 调相相偏 + ElMessage.warning('调相相偏 不能为空') + return false + } + else if (form.value.noHarmonic && !noHarmonicList.value.length) { // 非谐波 + ElMessage.warning('非谐波 不能为空') + return false + } + + // 验数据 + let frequencyResult = true // 频率 + let powerResult = true // 功率 + let amplitudeModulationDepthResult = true // 调幅深度 + let frequencyModulationDeviationResult = true // 调频频偏 + let residentialAmplitudeModulationResult = true // 剩余调幅 + let residentialFrequencyModulationResult = true // 剩余调频 + let harmonicResult = true // 谐波 + let phaseResult = true // 调相相偏 + let noHarmonicResult = true // 非谐波 + if (form.value.frequency) { + frequencyResult = checkList(frequencyList.value, '频率') + } + if (form.value.power) { + powerResult = checkList(powerList.value, '功率') + } + if (form.value.amplitudeModulationDepth) { + amplitudeModulationDepthResult = checkList(amplitudeModulationDepthList.value, '调幅深度') + } + if (form.value.frequencyModulationDeviation) { + frequencyModulationDeviationResult = checkList(frequencyModulationDeviationList.value, '调频频偏') + } + if (form.value.remainAmplitudeModulation) { + residentialAmplitudeModulationResult = checkList(residentialAmplitudeModulationList.value, '剩余调幅') + } + if (form.value.remainFrequencyModulation) { + residentialFrequencyModulationResult = checkList(residentialFrequencyModulationList.value, '剩余调频') + } + if (form.value.harmonic) { + harmonicResult = checkList(harmonicList.value, '谐波') + } + if (form.value.phaseModulationPhaseDeviation) { + phaseResult = checkList(phaseList.value, '调相相偏') + } + if (form.value.noHarmonic) { + noHarmonicResult = checkList(noHarmonicList.value, '非谐波') + } + if (frequencyResult + && powerResult + && amplitudeModulationDepthResult + && frequencyModulationDeviationResult + && residentialAmplitudeModulationResult + && residentialFrequencyModulationResult + && harmonicResult + && phaseResult && noHarmonicResult + ) { + return true + } + else { + return false + } +} + +// 保存之前处理数据 +const solveDataBeforeSave = () => { + // 数据处理 + let tempList = [] as any + if (form.value.frequency) { // 频率 + tempList = tempList.concat(frequencyList.value) + } + if (form.value.power) { // 功率 + tempList = tempList.concat(powerList.value) + } + if (form.value.amplitudeModulationDepth) { // 调幅深度 + tempList = tempList.concat(amplitudeModulationDepthList.value) + } + if (form.value.frequencyModulationDeviation) { // 调频频偏 + tempList = tempList.concat(frequencyModulationDeviationList.value) + } + if (form.value.remainAmplitudeModulation) { // 剩余调幅 + tempList = tempList.concat(residentialAmplitudeModulationList.value) + } + if (form.value.remainFrequencyModulation) { // 剩余调频 + tempList = tempList.concat(residentialFrequencyModulationList.value) + } + if (form.value.harmonic) { // 谐波 + tempList = tempList.concat(harmonicList.value) + } + if (form.value.phaseModulationPhaseDeviation) { // 调相相偏 + tempList = tempList.concat(phaseList.value) + } + if (form.value.noHarmonic) { // 非谐波 + tempList = tempList.concat(noHarmonicList.value) + } + tempList = tempList.map((item: { id: string }) => { + return { + ...item, + id: '', + } + }) + return tempList } // ------------------------------------------------------------------------------------------------ -// 点击计算结果--上方表格计算 -const calculateDataTop = () => { -} -// 点击生成辅助接地电阻--下面表格计算 -const calculateDataBottom = () => { +watch(() => props.list, (newVal) => { // 检定项表格 + if (newVal && newVal.length) { + frequencyList.value = newVal.filter((item: any) => `${item.dataType}` === '1').map((item: any) => { item.params = '频率'; return item }) + powerList.value = newVal.filter((item: any) => `${item.dataType}` === '2').map((item: any) => { item.params = '功率'; return item }) + amplitudeModulationDepthList.value = newVal.filter((item: any) => `${item.dataType}` === '3').map((item: any) => { item.params = '调幅深度'; return item }) + frequencyModulationDeviationList.value = newVal.filter((item: any) => `${item.dataType}` === '4').map((item: any) => { item.params = '调频频偏'; return item }) + residentialAmplitudeModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '5').map((item: any) => { item.params = '剩余调幅'; return item }) + residentialFrequencyModulationList.value = newVal.filter((item: any) => `${item.dataType}` === '6').map((item: any) => { item.params = '剩余调频'; return item }) + harmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '7').map((item: any) => { item.params = '谐波'; return item }) + phaseList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '调相相偏'; return item }) + noHarmonicList.value = newVal.filter((item: any) => `${item.dataType}` === '8').map((item: any) => { item.params = '非谐波'; return item }) + } +}) -} -// ----------------------------------------------------------------------------------------------------- +watch(() => props.form, (newValue) => { + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = `${newValue.appearanceFunctionCheck}` === '' ? 1 : newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.frequency = `${newValue.frequency}` === '' ? 1 : newValue.frequency // 频率 + form.value.power = `${newValue.power}` === '' ? 1 : newValue.power // 功率 + form.value.amplitudeModulationDepth = `${newValue.amplitudeModulationDepth}` === '' ? 1 : newValue.amplitudeModulationDepth // 调幅深度 + form.value.frequencyModulationDeviation = `${newValue.frequencyModulationDeviation}` === '' ? 1 : newValue.frequencyModulationDeviation // 调频频偏 + form.value.remainAmplitudeModulation = `${newValue.remainAmplitudeModulation}` === '' ? 1 : newValue.remainAmplitudeModulation // 剩余调幅 + form.value.remainFrequencyModulation = `${newValue.remainFrequencyModulation}` === '' ? 1 : newValue.remainFrequencyModulation // 剩余调频 + form.value.harmonic = `${newValue.harmonic}` === '' ? 1 : newValue.harmonic // 谐波 + form.value.phaseModulationPhaseDeviation = `${newValue.phaseModulationPhaseDeviation}` === '' ? 1 : newValue.phaseModulationPhaseDeviation // 调相相偏 + form.value.noHarmonic = `${newValue.noHarmonic}` === '' ? 1 : newValue.noHarmonic // 非谐波 + } +}, { deep: true, immediate: true }) -// watch(() => props.list, (newVal) => { // 检定项表格 -// if (newVal) { -// list.value = [...newVal] -// } -// }) - -// defineExpose({ list }) +defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/tenth/templateTable.vue b/src/views/business/measure/item/components/tenth/templateTable.vue index 9730d79..b1c9872 100644 --- a/src/views/business/measure/item/components/tenth/templateTable.vue +++ b/src/views/business/measure/item/components/tenth/templateTable.vue @@ -38,22 +38,38 @@ type: String, default: 'default', }, // 表格大小,默认,small,mini等,与el-table条件相同 + type: String, }) const emit = defineEmits(['change', 'selectionChange', 'rowClick', 'rowDbClick', 'multiSelect', 'filterChange']) // ------------------------------------------字典---------------------------------------------- -const paramsList = ref([]) // 参数 - +// ------------------------------------------字典---------------------------------------------- +const standardTechnicalIndexSymbolList = ref([]) // 技术指标规则 +const standardAmplitudeUnitList = ref([]) // 幅度单位 +const standardFrequencyUnitList = ref([]) // 频率单位-公用 +const standard10HarmonicNumberList = ref([]) // 谐波次数 /** * 获取字典 */ function getDict() { - // 参数 - getDictByCode('bizFirstStandardParams').then((response) => { - paramsList.value = response.data + // 技术指标规则 + getDictByCode('standardTechnicalIndexSymbol').then((response) => { + standardTechnicalIndexSymbolList.value = response.data + }) + // 幅度单位 + getDictByCode('standardAmplitudeUnit').then((response) => { + standardAmplitudeUnitList.value = response.data + }) + // 频率单位公用 + getDictByCode('standardFrequencyUnit').then((response) => { + standardFrequencyUnitList.value = response.data + }) + // 谐波次数 + getDictByCode('standard10HarmonicNumber').then((response) => { + standard10HarmonicNumberList.value = response.data }) } -// getDict() +getDict() // -------定义数据-------------- interface columnsCheckInfo { text: string @@ -87,7 +103,7 @@ } // 多选选中结果 -function selectionChange(selection: []) { +function handleSelectionChange(selection: []) { emit('selectionChange', selection) } // 点击行 @@ -103,10 +119,7 @@ initColumnsState() changeColumns() }) -// 多选 -const handleSelectionChange = (val: any) => { - emit('multiSelect', val) -} + // 清除多选选中 const clearMulti = () => { console.log('清理选中') @@ -149,6 +162,173 @@ + diff --git a/src/views/business/measure/item/components/thirteenth/templateDetail.vue b/src/views/business/measure/item/components/thirteenth/templateDetail.vue index 52080b9..8b26394 100644 --- a/src/views/business/measure/item/components/thirteenth/templateDetail.vue +++ b/src/views/business/measure/item/components/thirteenth/templateDetail.vue @@ -825,25 +825,25 @@ if (form.value.timeBase) { timeBaseResult = checkList(timeBaseList.value, '时基') } - else if (form.value.currentGain) { + if (form.value.currentGain) { currentGainResult = checkList(zeroFrequencyGainList.value, '直流增益') } - else if (form.value.currentBias) { + if (form.value.currentBias) { currentBiasResult = checkList(DCBiasList.value, '直流偏置') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthList.value, '频带宽度') } - else if (form.value.triggerSensitivity) { + if (form.value.triggerSensitivity) { triggerSensitivityResult = checkList(triggerSensitivityList.value, '触发灵敏度') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeList.value, '上升时间') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceList.value, '输入电阻') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalList.value, '校准信号') } if (timeBaseResult && currentGainResult && currentBiasResult && bandWidthResult && triggerSensitivityResult && riseTimeResult && inputResistanceResult && calibratingSignalResult) { @@ -858,22 +858,22 @@ if (form.value.scanTimeCoefficient) { scanTimeCoefficientResult = checkList(scanningTimeList.value, '扫描时间系数及扩展') } - else if (form.value.verticalAmplitude) { + if (form.value.verticalAmplitude) { verticalAmplitudeResult = checkList(verticalSizeList.value, '垂直幅度') } - else if (form.value.bandWidth) { + if (form.value.bandWidth) { bandWidthResult = checkList(frequencyBandwidthSimulateList.value, '频带宽度') } - else if (form.value.triggerCharacter) { + if (form.value.triggerCharacter) { triggerCharacterResult = checkList(triggerCharacteristicList.value, '触发特性') } - else if (form.value.inputResistance) { + if (form.value.inputResistance) { inputResistanceResult = checkList(inputResistanceSimulateList.value, '输入电阻') } - else if (form.value.riseTime) { + if (form.value.riseTime) { riseTimeResult = checkList(risetimeSimulateList.value, '上升时间') } - else if (form.value.calibratingSignal) { + if (form.value.calibratingSignal) { calibratingSignalResult = checkList(calibratingSignalSimulateList.value, '校准信号') } if (scanTimeCoefficientResult && verticalAmplitudeResult && bandWidthResult && triggerCharacterResult && inputResistanceResult && riseTimeResult && calibratingSignalResult @@ -1054,18 +1054,20 @@ }) watch(() => props.form, (newValue) => { - form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 - form.value.timeBase = newValue.timeBase // 时基(示波器-数字) - form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) - form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) - form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) - form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) - form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) - form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) - form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) - form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) - form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) - form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + if (newValue && Object.keys(newValue).length) { + form.value.appearanceFunctionCheck = newValue.appearanceFunctionCheck // 外观及功能性检查 + form.value.timeBase = newValue.timeBase // 时基(示波器-数字) + form.value.scanTimeCoefficient = newValue.scanTimeCoefficient // 扫描时间系数及扩展(示波器-模拟) + form.value.bandWidth = newValue.bandWidth // 频带宽度(示波器-数字/模拟) + form.value.calibratingSignal = newValue.calibratingSignal // 校准信号(示波器-数字/模拟) + form.value.currentBias = newValue.currentBias // 直流偏置(示波器-数字) + form.value.currentGain = newValue.currentGain // 直流增益(示波器-数字) + form.value.inputResistance = newValue.inputResistance // 输入电阻(示波器-数字/模拟) + form.value.riseTime = newValue.riseTime // 上升时间(示波器-数字/模拟) + form.value.triggerCharacter = newValue.triggerCharacter // 触发特性(示波器-模拟) + form.value.triggerSensitivity = newValue.triggerSensitivity // 触发灵敏度(示波器-数字) + form.value.verticalAmplitude = newValue.verticalAmplitude // 垂直幅度(示波器-模拟) + } }, { deep: true, immediate: true }) defineExpose({ checkListBeforeSave, solveDataBeforeSave, form }) diff --git a/src/views/business/measure/item/components/thirteenth/templateTable.vue b/src/views/business/measure/item/components/thirteenth/templateTable.vue index 7dbaee8..1ff1a29 100644 --- a/src/views/business/measure/item/components/thirteenth/templateTable.vue +++ b/src/views/business/measure/item/components/thirteenth/templateTable.vue @@ -107,10 +107,6 @@ getDictByCode('standardAmplitudeUnit').then((response) => { standardAmplitudeUnitList.value = response.data }) - // 幅度单位 - getDictByCode('standardAmplitudeUnit').then((response) => { - standardAmplitudeUnitList.value = response.data - }) // 校准信号--项目 getDictByCode('standard13Item').then((response) => { standard13ItemList.value = response.data diff --git a/src/views/business/measure/item/detail.vue b/src/views/business/measure/item/detail.vue index a03eedf..16a5eb1 100644 --- a/src/views/business/measure/item/detail.vue +++ b/src/views/business/measure/item/detail.vue @@ -359,6 +359,17 @@ })), // 鉴定项列表 } } + else if (form.value.belongStandardEquipment === '10') { // 第10套:信号发生器 + if (!standardRef.value.checkListBeforeSave()) { params = '未通过校验'; return params } + const list = standardRef.value.solveDataBeforeSave() // 处理数据 + params = { + helpFieldInstruction: form.value.helpFieldInstruction, // 辅助字段说明 + itemRemark: form.value.itemRemark, // 检定项备注 + itemId: infoId.value, // 检定项id + measureItemDataSignalGeneratorList: list, + ...standardRef.value.form, + } + } else if (form.value.belongStandardEquipment === '13') { // 第13套:示波器 if (!standardRef.value.checkListBeforeSave()) { params = '未通过校验'; return params } const list = standardRef.value.solveDataBeforeSave() // 处理数据 @@ -553,6 +564,10 @@ getList.value = response.measureItemDataSpectrumAnalyzerList // 检定项表格 getObject.value = response // 检定项表单 } + else if (form.value.belongStandardEquipment === '10') { // 第10套:信号发生器 + getList.value = response.measureItemDataSignalGeneratorList // 检定项表格 + getObject.value = response // 检定项表单 + } else if (form.value.belongStandardEquipment === '13') { // 第13套:示波器 getList.value = response.measureItemDataOscilloscopeList // 检定项表格 getObject.value = response // 检定项表单 diff --git a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue index f34605c..13878a2 100644 --- a/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/thirteenth/checkDataCom.vue @@ -77,9 +77,9 @@ const columns_repeatability_voltage_flatness = ref([ // 重复性表头--稳幅正弦信号电压平坦度 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '类型', value: 'typeValue', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'text' }, - { text: '测量值单位', value: 'testValueUnit', align: 'center', required: true, type: 'text' }, - { text: '转换为电压值单位', value: 'convertVoltageUnit', align: 'center', required: true, type: 'text' }, + { text: '核查点', value: 'checkPointDefineFront', align: 'center', required: true, type: 'text' }, + { text: '测量值单位', value: 'testValueUnit', width: '100', align: 'center', required: true, type: 'select', options: [{ text: 'kW', value: 'kW' }, { text: 'W', value: 'W' }, { text: 'mW', value: 'mW' }, { text: 'μW', value: 'μW' }] }, + { text: '转换为电压值单位', value: 'convertVoltageUnit', width: '100', align: 'center', required: true, type: 'select', options: [{ text: 'kV', value: 'kV' }, { text: 'V', value: 'V' }, { text: 'mV', value: 'mV' }, { text: 'μV', value: 'μV' }] }, { text: 'X1', value: '-', @@ -88,8 +88,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessOne', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageOne', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessOne', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -100,8 +100,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessTwo', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageTwo', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessTwo', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -112,8 +112,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessThree', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageThree', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessThree', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -124,8 +124,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessFour', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageFour', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessFour', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -136,8 +136,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessFive', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageFive', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessFive', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -148,8 +148,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessSix', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageSix', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessSix', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -160,8 +160,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessSeven', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageSeven', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessSeven', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -172,8 +172,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessEight', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageEight', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessEight', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -184,8 +184,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessNine', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageNine', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessNine', align: 'center', required: false, width: '180', type: 'text' }, ], }, { @@ -196,8 +196,8 @@ width: '180', children: [ { text: '测量值', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '转换为电压值', value: 'convertVoltageTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, - { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: true, width: '180', type: 'inputNumber' }, + { text: '转换为电压值', value: 'convertVoltageTen', align: 'center', required: false, width: '180', type: 'text' }, + { text: '平坦度/%', value: 'flatnessTen', align: 'center', required: false, width: '180', type: 'text' }, ], }, { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, @@ -210,7 +210,7 @@ { text: '探头出厂编号', value: 'manufactureNo', align: 'center', required: false }, { text: '探头设备名称', value: 'equipmentName', align: 'center', required: false }, { text: '探头规格型号', value: 'model', align: 'center', required: false }, - { text: '测量值', value: 'testValueOne', align: 'center', required: true }, + { text: '测量值', value: 'testValueOne', align: 'center', required: true, width: '180' }, ]) const columns_stability_timeMark = ref([ // 稳定性表头--时标 @@ -710,6 +710,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 方波电压(50Ω)稳定性 @@ -750,6 +760,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 方波电压(1MΩ)稳定性 @@ -790,6 +810,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 直流电压(50Ω)稳定性 @@ -830,6 +860,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 直流电压(1MΩ)稳定性 @@ -870,6 +910,16 @@ maximumErrorAbsolute: e.maximumErrorAbsolute, // 最大允许误差的绝对值 maximumErrorAbsoluteUnit: e.maximumErrorAbsoluteUnit, // 最大允许误差的绝对值单位 maximumErrorAbsoluteUnitDefineFront: e.maximumErrorAbsolute + e.maximumErrorAbsoluteUnit, + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 输入阻抗稳定性 @@ -896,6 +946,11 @@ listVoltageFlatnessRepeatability.value = list.filter((item: { params: string }) => item.params === '稳幅正弦信号电压平坦度') // 稳幅正弦信号电压平坦度重复性 listVoltageFlatnessRepeatability.value = listVoltageFlatnessRepeatability.value.map((e: any) => { + let tempCheckPoint = e.checkPoint + e.unit + if (`${e.referencePoint}` === '1') { + tempCheckPoint = `${tempCheckPoint}(参考)` + } + return { editable: type === 'edit', dataId: e.id, // 核查数据管理基础信息表id @@ -907,7 +962,8 @@ convertVoltageUnit: 'V', // 转换为电压值单位 checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) - checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + checkPointDefineFront: tempCheckPoint, // 核查点 + referencePoint: e.referencePoint, // 是否为参考点 flatnessOne: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度1/% flatnessTwo: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度2/% flatnessThree: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度3/% @@ -920,6 +976,16 @@ flatnessTen: `${e.referencePoint}` === '1' ? '/' : '', // 平坦度10/% averageValue: '', // 平均值 standardDeviation: '', // 重复性 + testValueOne: 0, // 测量值1/测量值(上升时间) + testValueTwo: 0, // 测量值2(示值) + testValueThree: 0, // 测量值3(示值) + testValueFour: 0, // 测量值4(示值) + testValueFive: 0, // 测量值5(示值) + testValueSix: 0, // 测量值6(本次示值) + testValueSeven: 0, // 测量值7 + testValueEight: 0, // 测量值8 + testValueNine: 0, // 测量值9 + testValueTen: 0, // 测量值10 } }) // 稳幅正弦信号电压平坦度稳定性 @@ -932,6 +998,7 @@ checkPoint: e.checkPoint, // 核查点 unit: e.unit, // 单位(直接存字典value) checkPointDefineFront: e.checkPoint + e.unit, // 核查点 + referencePoint: e.referencePoint, // 是否为参考点 checkType: '稳定性', averageValue: '', // 平均值 stability: '', // 稳定性 @@ -979,11 +1046,12 @@ manufactureNo: e.manufactureNo, // 探头出厂编号 equipmentName: e.equipmentName, // 探头设备名称 model: e.model, // 探头规格型号 - testValueOne: '', // 测量值 + testValueOne: e.testValueOne, // 测量值 technicalIndex: e.technicalIndex, // 技术指标 technicalIndexSymbol: e.technicalIndexSymbol, // 技术指标前符号 technicalIndexUnit: e.technicalIndexUnit, // 技术指标单位 conclusion: '', // 结论 + technicalIndexDefineFront: e.technicalIndexSymbol + e.technicalIndex + e.technicalIndexUnit, } }) } @@ -991,99 +1059,80 @@ // 点击计算结果 const createResult = (type: string) => { let checkDataOscilloscopeListParams: any // 要传的重复或者稳定性参数 - if (current.value === 'stability') { // 计算稳定性 - switch (type) { - case '时标': - if (!listTimeMarkRepeatability.value.length) { - ElMessage.warning('时标 未配置重复性,请检查') - return false - } - if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listTimeMarkStability.value - break - case '方波电压(50Ω)': - if (!listSquareWaveVoltage50ΩRepeatability.value.length) { - ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') - return false - } - if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value - break - case '方波电压(1MΩ)': - if (!listSquareWaveVoltage1MΩRepeatability.value.length) { - ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') - return false - } - if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value - break - case '直流电压(50Ω)': - if (!listDirectVoltage50ΩRepeatability.value.length) { - ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') - return false - } - if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value - break - case '直流电压(1MΩ)': - if (!listDirectVoltage1MΩRepeatability.value.length) { - ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') - return false - } - if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value - break - case '输入阻抗': - if (!listInputImpedanceRepeatability.value.length) { - ElMessage.warning('输入阻抗 未配置重复性,请检查') - return false - } - if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listInputImpedanceStability.value - break - case '稳幅正弦信号电压平坦度': - if (!listVoltageFlatnessRepeatability.value.length) { - ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') - return false - } - if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listVoltageFlatnessStability.value - break - case '上升时间': - if (!listRisetimeRepeatability.value.length) { - ElMessage.warning('上升时间 未配置重复性,请检查') - return false - } - if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { - ElMessage.warning(`请先计算 ${type} 重复性`) - return false - } - checkDataOscilloscopeListParams = listRisetimeStability.value - break - default: - break - } + if (current.value === 'stability') { // 计算稳定性先校验重复性 + if (!checkList()) { return false } + // if (!listTimeMarkRepeatability.value.length) { + // ElMessage.warning('时标 未配置重复性,请检查') + // return false + // } + // if (`${listTimeMarkRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 时标 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listTimeMarkStability.value + // if (!listSquareWaveVoltage50ΩRepeatability.value.length) { + // ElMessage.warning('方波电压(50Ω) 未配置重复性,请检查') + // return false + // } + // if (`${listSquareWaveVoltage50ΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 方波电压(50Ω) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listSquareWaveVoltage50ΩStability.value + // if (!listSquareWaveVoltage1MΩRepeatability.value.length) { + // ElMessage.warning('方波电压(1MΩ) 未配置重复性,请检查') + // return false + // } + // if (`${listSquareWaveVoltage1MΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 方波电压(1MΩ) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listSquareWaveVoltage1MΩStability.value + // if (!listDirectVoltage50ΩRepeatability.value.length) { + // ElMessage.warning('直流电压(50Ω) 未配置重复性,请检查') + // return false + // } + // if (`${listDirectVoltage50ΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 直流电压(50Ω) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listDirectVoltage50ΩStability.value + // if (!listDirectVoltage1MΩRepeatability.value.length) { + // ElMessage.warning('直流电压(1MΩ) 未配置重复性,请检查') + // return false + // } + // if (`${listDirectVoltage1MΩRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 直流电压(1MΩ) 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listDirectVoltage1MΩStability.value + // if (!listInputImpedanceRepeatability.value.length) { + // ElMessage.warning('输入阻抗 未配置重复性,请检查') + // return false + // } + // if (`${listInputImpedanceRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 输入阻抗 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listInputImpedanceStability.value + // if (!listVoltageFlatnessRepeatability.value.length) { + // ElMessage.warning('稳幅正弦信号电压平坦度 未配置重复性,请检查') + // return false + // } + // if (`${listVoltageFlatnessRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 稳幅正弦信号电压平坦度 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listVoltageFlatnessStability.value + // if (!listRisetimeRepeatability.value.length) { + // ElMessage.warning('上升时间 未配置重复性,请检查') + // return false + // } + // if (`${listRisetimeRepeatability.value[0].averageValue}` === '') { + // ElMessage.warning(`请先计算 上升时间 重复性`) + // return false + // } + checkDataOscilloscopeListParams = listRisetimeStability.value } if (current.value === 'repeatability') { @@ -1759,6 +1808,11 @@ currentDate.value = date } +// 上升时间测量值变化 +const changeTestValueOne = (val: number, index: number) => { + listRisetimeStability.value[index].testValueOne = listRisetimeRepeatability.value[index].testValueOne +} + // -------------------------------------钩子----------------------------------------------------- // 统计日期 const dateCount = (columns: TableColumn[]) => { @@ -1829,15 +1883,6 @@ }) }, { immediate: true }) -watch(() => current.value, (value) => { - console.log('重复性') - console.log(listTimeMarkRepeatability.value) - console.log('稳定性') - console.log(listTimeMarkStability.value) - listTimeMarkRepeatability.value = [...listTimeMarkRepeatability.value] - listTimeMarkStability.value = [...listTimeMarkStability.value] -}) - onMounted(async () => { belongStandardEquipment.value = $route.query.belongStandardEquipment as string // 检校标准装置 itemCategoryId.value = $route.query.itemCategoryId as string // 核查项分类id @@ -1846,7 +1891,7 @@ fetchInfo() } }) -defineExpose({ fetchCheckItemDetail }) +defineExpose({ fetchCheckItemDetail, checkList }) diff --git a/src/views/equipement/standard/checkData/detail.vue b/src/views/equipement/standard/checkData/detail.vue index 0d766f9..4ed7122 100644 --- a/src/views/equipement/standard/checkData/detail.vue +++ b/src/views/equipement/standard/checkData/detail.vue @@ -451,6 +451,23 @@ belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 } } + else if (belongStandardEquipment.value === '13') { // 示波器 + if (!checkDataRef.value.checkList()) { params = '未通过校验'; return params } + // const list = checkDataRef.value.getList() + // params = { + // ...form.value, + // checkEquipmentIdList: equipmentList.value.map(item => item.id), // 核查标准设备 + // equipmentName: chekedEquipmentList.value[0].equipmentName, // 被核查标准设备名称 + // equipmentId: chekedEquipmentList.value[0].equipmentId, // 被核查标准设备id + // createUserId: user.id, // 核查员id + // createUserName: user.name, // 核查员 + // itemCategoryId: chekedEquipmentList.value[0].itemCategoryId, // 核查项分类id + // itemCategoryName: itemCategoryName.value, // 核查项分类name + // standardEquipmentId: selectStandardId.value, // 被核查标准装置id + // id: infoId.value, + // belongStandardEquipment: belongStandardEquipment.value, // 检校标准装置 + // } + } return params }