diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/views/business/measure/item/components/ninth/templateDetail.vue b/src/views/business/measure/item/components/ninth/templateDetail.vue index 5dba6ff..602876e 100644 --- a/src/views/business/measure/item/components/ninth/templateDetail.vue +++ b/src/views/business/measure/item/components/ninth/templateDetail.vue @@ -130,7 +130,7 @@ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'frequencyNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth', isData: true }, + { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth' }, { text: '扫频宽度单位', value: 'sweepWidthUnit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -144,7 +144,7 @@ const columns_sweep_width = ref([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -157,7 +157,7 @@ const columns_intermediate_frequency_bandwidth = ref([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -168,7 +168,7 @@ const columns_transition_deviation = ref([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -180,7 +180,7 @@ const columns_reference_electrical_level = ref([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, @@ -198,7 +198,7 @@ { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude', isData: true }, + { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude' }, { text: '信号源幅度单位', value: 'signalSourceAmplitudeUnit', align: 'center', required: true, type: 'select' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'verticalScaleFrequency' }, @@ -219,9 +219,9 @@ ]) const columns_average_noise_level = ref([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency', isData: true }, + { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency' }, { text: '起始频率单位', value: 'startFrequencyUnit', align: 'center', required: true, type: 'select' }, - { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency', isData: true }, + { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency' }, { text: '终止频率单位', value: 'endFrequencyUnit', align: 'center', required: true, type: 'select' }, { text: '修正值', value: 'correctedValue', align: 'center', required: true, type: 'number' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'number' }, @@ -244,13 +244,13 @@ const columns_input_attenuator = ref([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '频谱仪参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, @@ -260,11 +260,11 @@ const columns_gain_compression_point = ref([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/views/business/measure/item/components/ninth/templateDetail.vue b/src/views/business/measure/item/components/ninth/templateDetail.vue index 5dba6ff..602876e 100644 --- a/src/views/business/measure/item/components/ninth/templateDetail.vue +++ b/src/views/business/measure/item/components/ninth/templateDetail.vue @@ -130,7 +130,7 @@ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'frequencyNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth', isData: true }, + { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth' }, { text: '扫频宽度单位', value: 'sweepWidthUnit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -144,7 +144,7 @@ const columns_sweep_width = ref([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -157,7 +157,7 @@ const columns_intermediate_frequency_bandwidth = ref([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -168,7 +168,7 @@ const columns_transition_deviation = ref([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -180,7 +180,7 @@ const columns_reference_electrical_level = ref([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, @@ -198,7 +198,7 @@ { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude', isData: true }, + { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude' }, { text: '信号源幅度单位', value: 'signalSourceAmplitudeUnit', align: 'center', required: true, type: 'select' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'verticalScaleFrequency' }, @@ -219,9 +219,9 @@ ]) const columns_average_noise_level = ref([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency', isData: true }, + { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency' }, { text: '起始频率单位', value: 'startFrequencyUnit', align: 'center', required: true, type: 'select' }, - { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency', isData: true }, + { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency' }, { text: '终止频率单位', value: 'endFrequencyUnit', align: 'center', required: true, type: 'select' }, { text: '修正值', value: 'correctedValue', align: 'center', required: true, type: 'number' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'number' }, @@ -244,13 +244,13 @@ const columns_input_attenuator = ref([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '频谱仪参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, @@ -260,11 +260,11 @@ const columns_gain_compression_point = ref([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/views/business/measure/item/components/second/templateDetail.vue b/src/views/business/measure/item/components/second/templateDetail.vue index 076f23f..c6a1758 100644 --- a/src/views/business/measure/item/components/second/templateDetail.vue +++ b/src/views/business/measure/item/components/second/templateDetail.vue @@ -119,7 +119,7 @@ // ----------------------------------------表头------------------------------------------------ const columns_line_voltage_regulation = ref([ // 电源电压调整率 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '调压器输出值', value: 'voltageRegulatorOutputValue', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, @@ -134,7 +134,7 @@ // 电压表示值误差(数字式)、电流表示值误差(直接测量)--(数字式) const columns_voltage_representation_value_error_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '误差参数a', value: 'errorParamA', align: 'center', required: true, type: 'number' }, @@ -149,7 +149,7 @@ // 电压表示值误差(指针式)、电流表示值误差(直接测量)--(指针式) const columns_voltage_representation_value_error_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '准确度a', value: 'accuracyA', align: 'center', required: true, type: 'number' }, @@ -159,7 +159,7 @@ // 电流表示值误差(间接测量)--数字式 const columns_ammeter_indirect_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -174,7 +174,7 @@ // 电流表示值误差(间接测量)--指针式 const columns_ammeter_indirect_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -186,14 +186,14 @@ // 纹波电压 const columns_ripple_voltage = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) // 输出电压短期稳定性 const columns_output_voltage_stability = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '仪器技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/views/business/measure/item/components/ninth/templateDetail.vue b/src/views/business/measure/item/components/ninth/templateDetail.vue index 5dba6ff..602876e 100644 --- a/src/views/business/measure/item/components/ninth/templateDetail.vue +++ b/src/views/business/measure/item/components/ninth/templateDetail.vue @@ -130,7 +130,7 @@ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'frequencyNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth', isData: true }, + { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth' }, { text: '扫频宽度单位', value: 'sweepWidthUnit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -144,7 +144,7 @@ const columns_sweep_width = ref([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -157,7 +157,7 @@ const columns_intermediate_frequency_bandwidth = ref([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -168,7 +168,7 @@ const columns_transition_deviation = ref([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -180,7 +180,7 @@ const columns_reference_electrical_level = ref([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, @@ -198,7 +198,7 @@ { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude', isData: true }, + { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude' }, { text: '信号源幅度单位', value: 'signalSourceAmplitudeUnit', align: 'center', required: true, type: 'select' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'verticalScaleFrequency' }, @@ -219,9 +219,9 @@ ]) const columns_average_noise_level = ref([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency', isData: true }, + { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency' }, { text: '起始频率单位', value: 'startFrequencyUnit', align: 'center', required: true, type: 'select' }, - { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency', isData: true }, + { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency' }, { text: '终止频率单位', value: 'endFrequencyUnit', align: 'center', required: true, type: 'select' }, { text: '修正值', value: 'correctedValue', align: 'center', required: true, type: 'number' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'number' }, @@ -244,13 +244,13 @@ const columns_input_attenuator = ref([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '频谱仪参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, @@ -260,11 +260,11 @@ const columns_gain_compression_point = ref([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/views/business/measure/item/components/second/templateDetail.vue b/src/views/business/measure/item/components/second/templateDetail.vue index 076f23f..c6a1758 100644 --- a/src/views/business/measure/item/components/second/templateDetail.vue +++ b/src/views/business/measure/item/components/second/templateDetail.vue @@ -119,7 +119,7 @@ // ----------------------------------------表头------------------------------------------------ const columns_line_voltage_regulation = ref([ // 电源电压调整率 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '调压器输出值', value: 'voltageRegulatorOutputValue', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, @@ -134,7 +134,7 @@ // 电压表示值误差(数字式)、电流表示值误差(直接测量)--(数字式) const columns_voltage_representation_value_error_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '误差参数a', value: 'errorParamA', align: 'center', required: true, type: 'number' }, @@ -149,7 +149,7 @@ // 电压表示值误差(指针式)、电流表示值误差(直接测量)--(指针式) const columns_voltage_representation_value_error_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '准确度a', value: 'accuracyA', align: 'center', required: true, type: 'number' }, @@ -159,7 +159,7 @@ // 电流表示值误差(间接测量)--数字式 const columns_ammeter_indirect_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -174,7 +174,7 @@ // 电流表示值误差(间接测量)--指针式 const columns_ammeter_indirect_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -186,14 +186,14 @@ // 纹波电压 const columns_ripple_voltage = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) // 输出电压短期稳定性 const columns_output_voltage_stability = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '仪器技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) diff --git a/src/views/business/measure/item/components/second/templateTable.vue b/src/views/business/measure/item/components/second/templateTable.vue index c81ca6d..19851b3 100644 --- a/src/views/business/measure/item/components/second/templateTable.vue +++ b/src/views/business/measure/item/components/second/templateTable.vue @@ -205,7 +205,7 @@ } // 获取字典value const getDictValue = (value1: any, value: any, index: number, text: string, type: string, list: any[], title: string) => { - // console.log(value, 'value') // + console.log(value, 'value') // // console.log(value, 'valuevaluevalue') emit('changeLoadSituationa', value1, index, text, type, list, title) } diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/views/business/measure/item/components/ninth/templateDetail.vue b/src/views/business/measure/item/components/ninth/templateDetail.vue index 5dba6ff..602876e 100644 --- a/src/views/business/measure/item/components/ninth/templateDetail.vue +++ b/src/views/business/measure/item/components/ninth/templateDetail.vue @@ -130,7 +130,7 @@ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'frequencyNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth', isData: true }, + { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth' }, { text: '扫频宽度单位', value: 'sweepWidthUnit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -144,7 +144,7 @@ const columns_sweep_width = ref([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -157,7 +157,7 @@ const columns_intermediate_frequency_bandwidth = ref([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -168,7 +168,7 @@ const columns_transition_deviation = ref([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -180,7 +180,7 @@ const columns_reference_electrical_level = ref([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, @@ -198,7 +198,7 @@ { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude', isData: true }, + { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude' }, { text: '信号源幅度单位', value: 'signalSourceAmplitudeUnit', align: 'center', required: true, type: 'select' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'verticalScaleFrequency' }, @@ -219,9 +219,9 @@ ]) const columns_average_noise_level = ref([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency', isData: true }, + { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency' }, { text: '起始频率单位', value: 'startFrequencyUnit', align: 'center', required: true, type: 'select' }, - { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency', isData: true }, + { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency' }, { text: '终止频率单位', value: 'endFrequencyUnit', align: 'center', required: true, type: 'select' }, { text: '修正值', value: 'correctedValue', align: 'center', required: true, type: 'number' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'number' }, @@ -244,13 +244,13 @@ const columns_input_attenuator = ref([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '频谱仪参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, @@ -260,11 +260,11 @@ const columns_gain_compression_point = ref([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/views/business/measure/item/components/second/templateDetail.vue b/src/views/business/measure/item/components/second/templateDetail.vue index 076f23f..c6a1758 100644 --- a/src/views/business/measure/item/components/second/templateDetail.vue +++ b/src/views/business/measure/item/components/second/templateDetail.vue @@ -119,7 +119,7 @@ // ----------------------------------------表头------------------------------------------------ const columns_line_voltage_regulation = ref([ // 电源电压调整率 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '调压器输出值', value: 'voltageRegulatorOutputValue', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, @@ -134,7 +134,7 @@ // 电压表示值误差(数字式)、电流表示值误差(直接测量)--(数字式) const columns_voltage_representation_value_error_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '误差参数a', value: 'errorParamA', align: 'center', required: true, type: 'number' }, @@ -149,7 +149,7 @@ // 电压表示值误差(指针式)、电流表示值误差(直接测量)--(指针式) const columns_voltage_representation_value_error_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '准确度a', value: 'accuracyA', align: 'center', required: true, type: 'number' }, @@ -159,7 +159,7 @@ // 电流表示值误差(间接测量)--数字式 const columns_ammeter_indirect_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -174,7 +174,7 @@ // 电流表示值误差(间接测量)--指针式 const columns_ammeter_indirect_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -186,14 +186,14 @@ // 纹波电压 const columns_ripple_voltage = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) // 输出电压短期稳定性 const columns_output_voltage_stability = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '仪器技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) diff --git a/src/views/business/measure/item/components/second/templateTable.vue b/src/views/business/measure/item/components/second/templateTable.vue index c81ca6d..19851b3 100644 --- a/src/views/business/measure/item/components/second/templateTable.vue +++ b/src/views/business/measure/item/components/second/templateTable.vue @@ -205,7 +205,7 @@ } // 获取字典value const getDictValue = (value1: any, value: any, index: number, text: string, type: string, list: any[], title: string) => { - // console.log(value, 'value') // + console.log(value, 'value') // // console.log(value, 'valuevaluevalue') emit('changeLoadSituationa', value1, index, text, type, list, title) } diff --git a/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue b/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue index e72d3dc..bf73f3a 100644 --- a/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue +++ b/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue @@ -104,7 +104,7 @@ { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '负载情况', value: 'loadSituation', align: 'center', required: false, type: 'text' }, - { text: '被检电源输出电压值', value: 'voltageOutputValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '被检电源输出电压值', value: 'voltageOutputValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 3 }, { text: '电压差值', value: 'voltageDifference', align: 'center', required: false, type: 'text' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' }, { text: '负载调整率', value: 'loadRegulation', align: 'center', required: false, type: 'text' }, @@ -115,18 +115,18 @@ { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, - { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 2 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 2 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 2 }, + { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) const columns_voltage_representation_value_error_1 = ref([ { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, - { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 3 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 3 }, + { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) // 电流示值误差(间接测量) const columns_ammeter_indirect = ref([ @@ -136,9 +136,9 @@ { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '标准电压值', value: 'standardVoltageValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '250', precision: 6 }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: false, type: 'text' }, - { text: '标准值', value: 'standardValue', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 3 }, + { text: '标准值', value: 'standardValue', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) // 纹波电压 const columns_ripple_voltage = ref([ @@ -249,7 +249,6 @@ else { initData = measureItemData.value.filter((citem: any) => citem.dataType === item.dataType)[index] } - console.log(initData, '对应的鉴定数据') // 1数字式、2指针式 if (item.dataTypeType === '1') { if (initData.maximumError === '2') { @@ -266,6 +265,58 @@ return (Number(initData.accuracyA) * Number(initData.fullScaleValue)) || 0 } } +// 保留小数位数 +const InterceptDecimal = (item: any, index: number) => { + // 1数字式、2指针式 + if (item.dataTypeType === '1') { + const decimal = item.resolution.includes('.') ? item.resolution.substring(item.resolution.indexOf('.'), item.resolution.length - 1).length : 0 + item.standardValue = Number(item.standardValue || 0).toFixed(decimal + 1) + item.maximumError = Number(item.maximumError || 0).toFixed(decimal + 1) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(decimal + 1) + switch (item.dataType) { + case '3': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电压示值误差' + break + case '4': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电流示值误差(直接测量)' + break + case '5': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电流示值误差(间接测量)' + break + } + } + else { + switch (item.dataType) { + case '3': + // 标准值、最大允许误差、绝对误差,保留小数点后2位 + item.params = '电压示值误差' + item.standardValue = Number(item.standardValue || 0).toFixed(2) + item.maximumError = Number(item.maximumError || 0).toFixed(2) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(2) + break + case '4': + // 标准值、最大允许误差、绝对误差,保留小数点后3位 + item.params = '电流示值误差(直接测量)' + item.standardValue = Number(item.standardValue || 0).toFixed(3) + item.maximumError = Number(item.maximumError || 0).toFixed(3) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(3) + break + case '5': + // 标准值、最大允许误差、绝对误差,保留小数点后3位 + item.params = '电流示值误差(间接测量)' + item.standardValue = Number(item.standardValue || 0).toFixed(3) + item.maximumError = Number(item.maximumError || 0).toFixed(3) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(3) + break + } + } + return { + ...item, + } +} // 初始化数据 function initAllData() { for (const i in listDict.value) { @@ -294,15 +345,15 @@ break case '3': // 电压示值误差 - voltageRepresentationValueErrorList.value.push({ ...item, params: '电压示值误差', absoluteError: transformDecimal(item.absoluteError, 2), standardValue: transformDecimal(item.standardValue, 2), maximumError: Number(calcMaxError(item, index, 'all') || 0).toFixed(2) }) + voltageRepresentationValueErrorList.value.push(InterceptDecimal(item, index)) break case '4': // 电流示值误差(直接测量) - ammeterDirectList.value.push({ ...item, params: '电流示值误差(直接测量)', absoluteError: transformDecimal(item.absoluteError, 3), standardValue: transformDecimal(item.standardValue, 3), maximumError: Number(calcMaxError(item, index, 'all') || 0).toFixed(3) }) + ammeterDirectList.value.push(InterceptDecimal(item, index)) break case '5': // 电流示值误差(间接测量) - ammeterIndirectList.value.push({ ...item, params: '电流示值误差(间接测量)', standardVoltageValue: transformDecimal(item.standardVoltageValue, 6), standardValue: transformDecimal(item.standardValue, 3), absoluteError: transformDecimal(item.absoluteError, 3), maximumError: Number(calcMaxError(item, index, 'all')).toFixed(3) }) + ammeterIndirectList.value.push(InterceptDecimal(item, index)) break case '6': // 纹波电压 diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/views/business/measure/item/components/ninth/templateDetail.vue b/src/views/business/measure/item/components/ninth/templateDetail.vue index 5dba6ff..602876e 100644 --- a/src/views/business/measure/item/components/ninth/templateDetail.vue +++ b/src/views/business/measure/item/components/ninth/templateDetail.vue @@ -130,7 +130,7 @@ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'frequencyNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth', isData: true }, + { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth' }, { text: '扫频宽度单位', value: 'sweepWidthUnit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -144,7 +144,7 @@ const columns_sweep_width = ref([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -157,7 +157,7 @@ const columns_intermediate_frequency_bandwidth = ref([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -168,7 +168,7 @@ const columns_transition_deviation = ref([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -180,7 +180,7 @@ const columns_reference_electrical_level = ref([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, @@ -198,7 +198,7 @@ { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude', isData: true }, + { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude' }, { text: '信号源幅度单位', value: 'signalSourceAmplitudeUnit', align: 'center', required: true, type: 'select' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'verticalScaleFrequency' }, @@ -219,9 +219,9 @@ ]) const columns_average_noise_level = ref([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency', isData: true }, + { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency' }, { text: '起始频率单位', value: 'startFrequencyUnit', align: 'center', required: true, type: 'select' }, - { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency', isData: true }, + { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency' }, { text: '终止频率单位', value: 'endFrequencyUnit', align: 'center', required: true, type: 'select' }, { text: '修正值', value: 'correctedValue', align: 'center', required: true, type: 'number' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'number' }, @@ -244,13 +244,13 @@ const columns_input_attenuator = ref([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '频谱仪参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, @@ -260,11 +260,11 @@ const columns_gain_compression_point = ref([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/views/business/measure/item/components/second/templateDetail.vue b/src/views/business/measure/item/components/second/templateDetail.vue index 076f23f..c6a1758 100644 --- a/src/views/business/measure/item/components/second/templateDetail.vue +++ b/src/views/business/measure/item/components/second/templateDetail.vue @@ -119,7 +119,7 @@ // ----------------------------------------表头------------------------------------------------ const columns_line_voltage_regulation = ref([ // 电源电压调整率 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '调压器输出值', value: 'voltageRegulatorOutputValue', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, @@ -134,7 +134,7 @@ // 电压表示值误差(数字式)、电流表示值误差(直接测量)--(数字式) const columns_voltage_representation_value_error_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '误差参数a', value: 'errorParamA', align: 'center', required: true, type: 'number' }, @@ -149,7 +149,7 @@ // 电压表示值误差(指针式)、电流表示值误差(直接测量)--(指针式) const columns_voltage_representation_value_error_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '准确度a', value: 'accuracyA', align: 'center', required: true, type: 'number' }, @@ -159,7 +159,7 @@ // 电流表示值误差(间接测量)--数字式 const columns_ammeter_indirect_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -174,7 +174,7 @@ // 电流表示值误差(间接测量)--指针式 const columns_ammeter_indirect_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -186,14 +186,14 @@ // 纹波电压 const columns_ripple_voltage = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) // 输出电压短期稳定性 const columns_output_voltage_stability = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '仪器技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) diff --git a/src/views/business/measure/item/components/second/templateTable.vue b/src/views/business/measure/item/components/second/templateTable.vue index c81ca6d..19851b3 100644 --- a/src/views/business/measure/item/components/second/templateTable.vue +++ b/src/views/business/measure/item/components/second/templateTable.vue @@ -205,7 +205,7 @@ } // 获取字典value const getDictValue = (value1: any, value: any, index: number, text: string, type: string, list: any[], title: string) => { - // console.log(value, 'value') // + console.log(value, 'value') // // console.log(value, 'valuevaluevalue') emit('changeLoadSituationa', value1, index, text, type, list, title) } diff --git a/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue b/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue index e72d3dc..bf73f3a 100644 --- a/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue +++ b/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue @@ -104,7 +104,7 @@ { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '负载情况', value: 'loadSituation', align: 'center', required: false, type: 'text' }, - { text: '被检电源输出电压值', value: 'voltageOutputValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '被检电源输出电压值', value: 'voltageOutputValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 3 }, { text: '电压差值', value: 'voltageDifference', align: 'center', required: false, type: 'text' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' }, { text: '负载调整率', value: 'loadRegulation', align: 'center', required: false, type: 'text' }, @@ -115,18 +115,18 @@ { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, - { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 2 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 2 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 2 }, + { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) const columns_voltage_representation_value_error_1 = ref([ { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, - { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 3 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 3 }, + { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) // 电流示值误差(间接测量) const columns_ammeter_indirect = ref([ @@ -136,9 +136,9 @@ { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '标准电压值', value: 'standardVoltageValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '250', precision: 6 }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: false, type: 'text' }, - { text: '标准值', value: 'standardValue', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 3 }, + { text: '标准值', value: 'standardValue', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) // 纹波电压 const columns_ripple_voltage = ref([ @@ -249,7 +249,6 @@ else { initData = measureItemData.value.filter((citem: any) => citem.dataType === item.dataType)[index] } - console.log(initData, '对应的鉴定数据') // 1数字式、2指针式 if (item.dataTypeType === '1') { if (initData.maximumError === '2') { @@ -266,6 +265,58 @@ return (Number(initData.accuracyA) * Number(initData.fullScaleValue)) || 0 } } +// 保留小数位数 +const InterceptDecimal = (item: any, index: number) => { + // 1数字式、2指针式 + if (item.dataTypeType === '1') { + const decimal = item.resolution.includes('.') ? item.resolution.substring(item.resolution.indexOf('.'), item.resolution.length - 1).length : 0 + item.standardValue = Number(item.standardValue || 0).toFixed(decimal + 1) + item.maximumError = Number(item.maximumError || 0).toFixed(decimal + 1) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(decimal + 1) + switch (item.dataType) { + case '3': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电压示值误差' + break + case '4': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电流示值误差(直接测量)' + break + case '5': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电流示值误差(间接测量)' + break + } + } + else { + switch (item.dataType) { + case '3': + // 标准值、最大允许误差、绝对误差,保留小数点后2位 + item.params = '电压示值误差' + item.standardValue = Number(item.standardValue || 0).toFixed(2) + item.maximumError = Number(item.maximumError || 0).toFixed(2) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(2) + break + case '4': + // 标准值、最大允许误差、绝对误差,保留小数点后3位 + item.params = '电流示值误差(直接测量)' + item.standardValue = Number(item.standardValue || 0).toFixed(3) + item.maximumError = Number(item.maximumError || 0).toFixed(3) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(3) + break + case '5': + // 标准值、最大允许误差、绝对误差,保留小数点后3位 + item.params = '电流示值误差(间接测量)' + item.standardValue = Number(item.standardValue || 0).toFixed(3) + item.maximumError = Number(item.maximumError || 0).toFixed(3) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(3) + break + } + } + return { + ...item, + } +} // 初始化数据 function initAllData() { for (const i in listDict.value) { @@ -294,15 +345,15 @@ break case '3': // 电压示值误差 - voltageRepresentationValueErrorList.value.push({ ...item, params: '电压示值误差', absoluteError: transformDecimal(item.absoluteError, 2), standardValue: transformDecimal(item.standardValue, 2), maximumError: Number(calcMaxError(item, index, 'all') || 0).toFixed(2) }) + voltageRepresentationValueErrorList.value.push(InterceptDecimal(item, index)) break case '4': // 电流示值误差(直接测量) - ammeterDirectList.value.push({ ...item, params: '电流示值误差(直接测量)', absoluteError: transformDecimal(item.absoluteError, 3), standardValue: transformDecimal(item.standardValue, 3), maximumError: Number(calcMaxError(item, index, 'all') || 0).toFixed(3) }) + ammeterDirectList.value.push(InterceptDecimal(item, index)) break case '5': // 电流示值误差(间接测量) - ammeterIndirectList.value.push({ ...item, params: '电流示值误差(间接测量)', standardVoltageValue: transformDecimal(item.standardVoltageValue, 6), standardValue: transformDecimal(item.standardValue, 3), absoluteError: transformDecimal(item.absoluteError, 3), maximumError: Number(calcMaxError(item, index, 'all')).toFixed(3) }) + ammeterIndirectList.value.push(InterceptDecimal(item, index)) break case '6': // 纹波电压 diff --git a/src/views/equipement/standard/book/components/config/ninth/config.vue b/src/views/equipement/standard/book/components/config/ninth/config.vue index 6c1abcd..490fd86 100644 --- a/src/views/equipement/standard/book/components/config/ninth/config.vue +++ b/src/views/equipement/standard/book/components/config/ninth/config.vue @@ -95,7 +95,7 @@ { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByFrequency' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '功率', value: 'power', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByPower', isData: true }, + { text: '功率', value: 'power', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByPower' }, { text: '功率单位', value: 'powerUnit', align: 'center', required: true, type: 'select' }, { text: '循环次数', value: 'cycleNumber', align: 'center', required: true, type: 'number' }, { text: '核查类型', value: 'checkType', align: 'center', required: false, type: 'select-multi' }, @@ -105,9 +105,9 @@ const columns_relative_level = ref([ // 相对电平表头 { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '组合方式', value: 'composition', align: 'center', required: true, type: 'select' }, - { text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel', isData: true }, + { text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '相对电平', value: 'relativeLevel', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel', isData: true }, + { text: '相对电平', value: 'relativeLevel', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel' }, { text: '相对电平单位', value: 'relativeLevelUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/components/SelectByDict/index.vue b/src/components/SelectByDict/index.vue index e6b15c9..5d68ab2 100644 --- a/src/components/SelectByDict/index.vue +++ b/src/components/SelectByDict/index.vue @@ -24,14 +24,14 @@ required: true, }, // 字典数组,传递了就不用组件内接口获取 - dictData: { - type: Array, - default: () => ([]), - }, - isData: { - type: Boolean, - default: false, - }, + // dictData: { + // type: Array, + // default: () => ([]), + // }, + // isData: { + // type: Boolean, + // default: false, + // }, }) const emit = defineEmits(['update:modelValue', 'getDictValue', 'changeValue']) const checkItem = ref({}) // 选中的选项 @@ -54,23 +54,25 @@ const dictList = ref<{ name: string;id: string;value: string }[]>([]) // 获取字典列表 const fetchDict = () => { - if (props.dictData.length) { - dictList.value = props.dictData - } - else if (props.isData) { - dictList.value = props.dictData - } - else { - getDictByCode(props.dictCode).then((res) => { - dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) - }) - } + // if (props.dictData.length) { + // dictList.value = props.dictData + // } + // else if (props.isData) { + // dictList.value = props.dictData + // } + // else { + getDictByCode(props.dictCode).then((res) => { + dictList.value = res.data.map((item: any) => ({ ...item, value1: item.value, value: item.name })) + // console.log(dictList.value, 'dictList.value') + }) + // } } -watch(() => props.dictData, (newVal) => { - if (newVal.length && props.isData) { - dictList.value = props.dictData - } -}) +// watch(() => props.dictData, (newVal) => { +// if (newVal.length && props.isData) { +// dictList.value = props.dictData.map((item: any) => ({ ...item, value1: item.value, value: item.name })) +// console.log(dictList.value, 'dictList.value-custom') +// } +// }) // 加载选项数据 const querySearch = (queryString: string, cb) => { const results = queryString diff --git a/src/views/business/measure/item/components/ninth/templateDetail.vue b/src/views/business/measure/item/components/ninth/templateDetail.vue index 5dba6ff..602876e 100644 --- a/src/views/business/measure/item/components/ninth/templateDetail.vue +++ b/src/views/business/measure/item/components/ninth/templateDetail.vue @@ -130,7 +130,7 @@ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'frequencyNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth', isData: true }, + { text: '扫频宽度', value: 'sweepWidth', align: 'center', required: true, type: 'select-dict', code: 'frequencysweepWidth' }, { text: '扫频宽度单位', value: 'sweepWidthUnit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -144,7 +144,7 @@ const columns_sweep_width = ref([ // 扫频宽度 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '水平分辨率', value: 'horizontalResolution', align: 'center', required: true, type: 'number' }, { text: '水平分辨率单位', value: 'horizontalResolutionUnit', align: 'center', required: true, type: 'select' }, @@ -157,7 +157,7 @@ const columns_intermediate_frequency_bandwidth = ref([ // 中频带宽 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -168,7 +168,7 @@ const columns_transition_deviation = ref([ // 中频带宽转换偏差 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'number' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, @@ -180,7 +180,7 @@ const columns_reference_electrical_level = ref([ // 参考电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue', isData: true }, + { text: '标称值', value: 'nominalValue', align: 'center', required: true, type: 'select-dict', code: 'sweepWidthNominalValue' }, { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, @@ -198,7 +198,7 @@ { text: '标称值单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'standardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude', isData: true }, + { text: '信号源幅度', value: 'signalSourceAmplitude', align: 'center', required: true, type: 'select-dict', code: 'signalSourceAmplitude' }, { text: '信号源幅度单位', value: 'signalSourceAmplitudeUnit', align: 'center', required: true, type: 'select' }, { text: '垂直刻度', value: 'verticalScale', align: 'center', required: true, type: 'select' }, { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'verticalScaleFrequency' }, @@ -219,9 +219,9 @@ ]) const columns_average_noise_level = ref([ // 平均噪声电平 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency', isData: true }, + { text: '起始频率', value: 'startFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelStartFrequency' }, { text: '起始频率单位', value: 'startFrequencyUnit', align: 'center', required: true, type: 'select' }, - { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency', isData: true }, + { text: '终止频率', value: 'endFrequency', align: 'center', required: true, type: 'select-dict', code: 'averageNoiseLevelEndFrequency' }, { text: '终止频率单位', value: 'endFrequencyUnit', align: 'center', required: true, type: 'select' }, { text: '修正值', value: 'correctedValue', align: 'center', required: true, type: 'number' }, { text: '指标上限', value: 'upperIndex', align: 'center', required: false, type: 'number' }, @@ -244,13 +244,13 @@ const columns_input_attenuator = ref([ // 输入衰减 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '标准衰减器衰减量', value: 'standardAttenuatorAttenuation', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '标准衰减器衰减量单位', value: 'standardAttenuatorAttenuationUnit', align: 'center', required: true, type: 'select' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '频谱仪参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '频谱仪参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, @@ -260,11 +260,11 @@ const columns_gain_compression_point = ref([ // 1dB增益压缩点 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation', isData: true }, + { text: '输入衰减器', value: 'inputAttenuator', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationStandardAttenuatorAttenuation' }, { text: '输入衰减器单位', value: 'inputAttenuatorUnit', align: 'center', required: true, type: 'select' }, - { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel', isData: true }, + { text: '参考电平', value: 'spectrumLevel', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationSpectrumLevel' }, { text: '参考电平单位', value: 'spectrumLevelUnit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency', isData: true }, + { text: '频率', value: 'frequency', align: 'center', required: true, type: 'select-dict', code: 'inputAttenuationFrequency' }, { text: '频率单位', value: 'frequencyUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/views/business/measure/item/components/second/templateDetail.vue b/src/views/business/measure/item/components/second/templateDetail.vue index 076f23f..c6a1758 100644 --- a/src/views/business/measure/item/components/second/templateDetail.vue +++ b/src/views/business/measure/item/components/second/templateDetail.vue @@ -119,7 +119,7 @@ // ----------------------------------------表头------------------------------------------------ const columns_line_voltage_regulation = ref([ // 电源电压调整率 { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '调压器输出值', value: 'voltageRegulatorOutputValue', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, @@ -134,7 +134,7 @@ // 电压表示值误差(数字式)、电流表示值误差(直接测量)--(数字式) const columns_voltage_representation_value_error_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '误差参数a', value: 'errorParamA', align: 'center', required: true, type: 'number' }, @@ -149,7 +149,7 @@ // 电压表示值误差(指针式)、电流表示值误差(直接测量)--(指针式) const columns_voltage_representation_value_error_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '准确度a', value: 'accuracyA', align: 'center', required: true, type: 'number' }, @@ -159,7 +159,7 @@ // 电流表示值误差(间接测量)--数字式 const columns_ammeter_indirect_number = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -174,7 +174,7 @@ // 电流表示值误差(间接测量)--指针式 const columns_ammeter_indirect_pointer = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: 'number' }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: true, type: 'number' }, @@ -186,14 +186,14 @@ // 纹波电压 const columns_ripple_voltage = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) // 输出电压短期稳定性 const columns_output_voltage_stability = ref([ { text: '检定项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel', isData: true }, + { text: '输出通道', value: 'outputChannel', align: 'center', required: true, type: 'select-dict', code: 'standardOutputChannel' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '仪器技术指标', value: 'technicalIndex', align: 'center', required: true, type: 'number' }, ]) diff --git a/src/views/business/measure/item/components/second/templateTable.vue b/src/views/business/measure/item/components/second/templateTable.vue index c81ca6d..19851b3 100644 --- a/src/views/business/measure/item/components/second/templateTable.vue +++ b/src/views/business/measure/item/components/second/templateTable.vue @@ -205,7 +205,7 @@ } // 获取字典value const getDictValue = (value1: any, value: any, index: number, text: string, type: string, list: any[], title: string) => { - // console.log(value, 'value') // + console.log(value, 'value') // // console.log(value, 'valuevaluevalue') emit('changeLoadSituationa', value1, index, text, type, list, title) } diff --git a/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue b/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue index e72d3dc..bf73f3a 100644 --- a/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue +++ b/src/views/business/taskMeasure/measureData/components/second/templateDetail.vue @@ -104,7 +104,7 @@ { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '负载情况', value: 'loadSituation', align: 'center', required: false, type: 'text' }, - { text: '被检电源输出电压值', value: 'voltageOutputValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '被检电源输出电压值', value: 'voltageOutputValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 3 }, { text: '电压差值', value: 'voltageDifference', align: 'center', required: false, type: 'text' }, { text: '被检电源技术指标', value: 'technicalIndex', align: 'center', required: false, type: 'text' }, { text: '负载调整率', value: 'loadRegulation', align: 'center', required: false, type: 'text' }, @@ -115,18 +115,18 @@ { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, - { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 2 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 2 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 2 }, + { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) const columns_voltage_representation_value_error_1 = ref([ { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '输出通道', value: 'outputChannel', align: 'center', required: false, type: 'text' }, { text: '单位', value: 'unit', align: 'center', required: false, type: 'text' }, { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, - { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', precision: 3 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 3 }, + { text: '标准值', value: 'standardValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) // 电流示值误差(间接测量) const columns_ammeter_indirect = ref([ @@ -136,9 +136,9 @@ { text: '被检表示值', value: 'measureIndicationValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number' }, { text: '标准电压值', value: 'standardVoltageValue', align: 'center', required: true, type: pageType.value === 'detail' ? 'text' : 'number', width: '250', precision: 6 }, { text: '标准电阻值', value: 'standardResistanceValue', align: 'center', required: false, type: 'text' }, - { text: '标准值', value: 'standardValue', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text', precision: 3 }, - { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text', precision: 3 }, + { text: '标准值', value: 'standardValue', align: 'center', required: false, type: 'text' }, + { text: '最大允许误差', value: 'maximumError', align: 'center', required: false, type: 'text' }, + { text: '绝对误差', value: 'absoluteError', align: 'center', required: false, type: 'text' }, ]) // 纹波电压 const columns_ripple_voltage = ref([ @@ -249,7 +249,6 @@ else { initData = measureItemData.value.filter((citem: any) => citem.dataType === item.dataType)[index] } - console.log(initData, '对应的鉴定数据') // 1数字式、2指针式 if (item.dataTypeType === '1') { if (initData.maximumError === '2') { @@ -266,6 +265,58 @@ return (Number(initData.accuracyA) * Number(initData.fullScaleValue)) || 0 } } +// 保留小数位数 +const InterceptDecimal = (item: any, index: number) => { + // 1数字式、2指针式 + if (item.dataTypeType === '1') { + const decimal = item.resolution.includes('.') ? item.resolution.substring(item.resolution.indexOf('.'), item.resolution.length - 1).length : 0 + item.standardValue = Number(item.standardValue || 0).toFixed(decimal + 1) + item.maximumError = Number(item.maximumError || 0).toFixed(decimal + 1) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(decimal + 1) + switch (item.dataType) { + case '3': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电压示值误差' + break + case '4': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电流示值误差(直接测量)' + break + case '5': + // 标准值、最大允许误差、绝对误差,比分辨力配置的,小数点后多一位 + item.params = '电流示值误差(间接测量)' + break + } + } + else { + switch (item.dataType) { + case '3': + // 标准值、最大允许误差、绝对误差,保留小数点后2位 + item.params = '电压示值误差' + item.standardValue = Number(item.standardValue || 0).toFixed(2) + item.maximumError = Number(item.maximumError || 0).toFixed(2) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(2) + break + case '4': + // 标准值、最大允许误差、绝对误差,保留小数点后3位 + item.params = '电流示值误差(直接测量)' + item.standardValue = Number(item.standardValue || 0).toFixed(3) + item.maximumError = Number(item.maximumError || 0).toFixed(3) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(3) + break + case '5': + // 标准值、最大允许误差、绝对误差,保留小数点后3位 + item.params = '电流示值误差(间接测量)' + item.standardValue = Number(item.standardValue || 0).toFixed(3) + item.maximumError = Number(item.maximumError || 0).toFixed(3) + item.absoluteError = Number(calcMaxError(item, index, 'all') || 0).toFixed(3) + break + } + } + return { + ...item, + } +} // 初始化数据 function initAllData() { for (const i in listDict.value) { @@ -294,15 +345,15 @@ break case '3': // 电压示值误差 - voltageRepresentationValueErrorList.value.push({ ...item, params: '电压示值误差', absoluteError: transformDecimal(item.absoluteError, 2), standardValue: transformDecimal(item.standardValue, 2), maximumError: Number(calcMaxError(item, index, 'all') || 0).toFixed(2) }) + voltageRepresentationValueErrorList.value.push(InterceptDecimal(item, index)) break case '4': // 电流示值误差(直接测量) - ammeterDirectList.value.push({ ...item, params: '电流示值误差(直接测量)', absoluteError: transformDecimal(item.absoluteError, 3), standardValue: transformDecimal(item.standardValue, 3), maximumError: Number(calcMaxError(item, index, 'all') || 0).toFixed(3) }) + ammeterDirectList.value.push(InterceptDecimal(item, index)) break case '5': // 电流示值误差(间接测量) - ammeterIndirectList.value.push({ ...item, params: '电流示值误差(间接测量)', standardVoltageValue: transformDecimal(item.standardVoltageValue, 6), standardValue: transformDecimal(item.standardValue, 3), absoluteError: transformDecimal(item.absoluteError, 3), maximumError: Number(calcMaxError(item, index, 'all')).toFixed(3) }) + ammeterIndirectList.value.push(InterceptDecimal(item, index)) break case '6': // 纹波电压 diff --git a/src/views/equipement/standard/book/components/config/ninth/config.vue b/src/views/equipement/standard/book/components/config/ninth/config.vue index 6c1abcd..490fd86 100644 --- a/src/views/equipement/standard/book/components/config/ninth/config.vue +++ b/src/views/equipement/standard/book/components/config/ninth/config.vue @@ -95,7 +95,7 @@ { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByFrequency' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '功率', value: 'power', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByPower', isData: true }, + { text: '功率', value: 'power', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByPower' }, { text: '功率单位', value: 'powerUnit', align: 'center', required: true, type: 'select' }, { text: '循环次数', value: 'cycleNumber', align: 'center', required: true, type: 'number' }, { text: '核查类型', value: 'checkType', align: 'center', required: false, type: 'select-multi' }, @@ -105,9 +105,9 @@ const columns_relative_level = ref([ // 相对电平表头 { text: '核查项目', value: 'params', align: 'center', required: false, type: 'text' }, { text: '组合方式', value: 'composition', align: 'center', required: true, type: 'select' }, - { text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel', isData: true }, + { text: '频率点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel' }, { text: '频率点单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '相对电平', value: 'relativeLevel', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel', isData: true }, + { text: '相对电平', value: 'relativeLevel', align: 'center', required: true, type: 'select-dict', code: 'powerDictValueByLevel' }, { text: '相对电平单位', value: 'relativeLevelUnit', align: 'center', required: true, type: 'select' }, { text: '幅度', value: 'amplitude', align: 'center', required: true, type: 'number' }, { text: '幅度单位', value: 'amplitudeUnit', align: 'center', required: true, type: 'select' }, diff --git a/src/views/equipement/standard/book/components/config/second/config.vue b/src/views/equipement/standard/book/components/config/second/config.vue index a0c611e..2be5afd 100644 --- a/src/views/equipement/standard/book/components/config/second/config.vue +++ b/src/views/equipement/standard/book/components/config/second/config.vue @@ -86,7 +86,7 @@ }) const columns_direct_voltage_DC_direct = ref([ // 直流电压表头、直流电流(直接测量) { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage', isData: true }, + { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '分辨力', value: 'resolution', align: 'center', required: true, type: 'input' }, { text: '循环次数', value: 'cycleNumber', align: 'center', required: true, type: 'number' }, @@ -96,7 +96,7 @@ const columns_effect = ref([ // 电源效应和负载效应 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage', isData: true }, + { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, { text: '是否为基准点', value: 'datumPoint', align: 'center', required: true, type: 'radio' }, { text: '分辨力', value: 'resolution', align: 'center', required: true, type: 'input' }, @@ -107,9 +107,9 @@ const columns_DC_indirect = ref([ // 直流电流(间接测量) { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage', isData: true }, + { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '电阻值', value: 'resistanceValue', align: 'center', required: true, type: 'select-dict', code: 'bizSecondStandardResistance', isData: true }, + { text: '电阻值', value: 'resistanceValue', align: 'center', required: true, type: 'select-dict', code: 'bizSecondStandardResistance' }, { text: '电阻值单位', value: 'resistanceValueUnit', align: 'center', required: true, type: 'select' }, { text: '分辨力', value: 'resolution', align: 'center', required: true, type: 'input' }, { text: '循环次数', value: 'cycleNumber', align: 'center', required: true, type: 'number' }, @@ -119,9 +119,9 @@ const columns_ripple_voltage = ref([ // 纹波电压 { text: '核查项目', value: 'params', align: 'center', required: true, type: 'text' }, - { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage', isData: true }, + { text: '核查点', value: 'checkPoint', align: 'center', required: true, type: 'select-dict', code: 'checkPointVoltage' }, { text: '单位', value: 'unit', align: 'center', required: true, type: 'select' }, - { text: '频率', value: 'resistanceValue', align: 'center', required: true, type: 'select-dict', code: 'bizSecondStandardFrequency', isData: true }, + { text: '频率', value: 'resistanceValue', align: 'center', required: true, type: 'select-dict', code: 'bizSecondStandardFrequency' }, { text: '频率单位', value: 'resistanceValueUnit', align: 'center', required: true, type: 'select' }, { text: '分辨力', value: 'resolution', align: 'center', required: true, type: 'input' }, { text: '循环次数', value: 'cycleNumber', align: 'center', required: true, type: 'number' },