<!-- 第四套:0.02级活塞式压力计标准库数据 --> <script lang="ts" setup name="TemplateDetailFourth"> import { ElMessage } from 'element-plus' import type { IList } from './templateDetail-interface' import type { dictType } from '@/global' import { getDictByCode } from '@/api/system/dict' import { calc } from '@/utils/useCalc' import { useCheckList } from '@/commonMethods/useCheckList' import { calculate, recalculate } from '@/api/business/measure/caculate' import { getDataNum, getDataUnit } from '@/utils/validate' const props = defineProps({ pageType: { type: String, default: 'add', }, itemCategoryName: { type: String, require: true, }, // 智能模型检定项分类名称 belongStandardEquipment: { // 检校标准装置code type: String, require: true, }, list: { type: Array as any, }, form: { // 检定项表单 type: Object as any, }, itemId: { // 检定项id type: String, default: '', }, }) const list = ref<IList[]>([]) // 表格数据 const ruleFormRef = ref() // 表单ref const ruleFormDeviationAndSwitchingRef = ref() // 设定点偏差及切换差表单ref const tableLoading = ref(false) const showValueTwo = ref(false) // 是否显示第2个 const showValueThree = ref(false) // 是否显示第3个 const form = ref({ rangeUpper: 0, // 量程上限 rangeLower: 0, // 量程下限 rangeUnit: 'MPa', // 量程单位 generateWay: '1', // 生成方式 points: 3, // 检定点个数 measureMedium: '', // 检定介质 division: 0, // 分度值的1/5 accuracyLevelLower: '', // 准确度等级(量程上限90%以下) accuracyLevelUpper: 0, // 准确度等级(量程上限90%及以上) zeroPosition: '0', // 零位是否带止销 accuracyLevel: 0, // 准确度等级 cycleNumber: 1, // 循环次数 deviationAndSwitching: 0, // 设定点偏差及切换差 displayValueOne: '', // 设定标准器示值1 displayValueTwo: '', // 设定标准器示值2 displayValueThree: '', // 设定标准器示值3 id: '', itemId: props.itemId, // 检定项id lastCycleSensitivity: '/', // 上一周期灵敏度b0(从检定数据中查) supplyVoltage: 24, // 供电电压 supplyVoltageUnit: 'V', // 供电电压单位 zeroPositionStop: '', // 零位(带止销) theoreticalOutputValueUnit: 'mA', // 理论输出值单位 appearance: 1, // 外观 tightness: 0, // 密封性 insulationResistance: 1, // 绝缘电阻 pointerDeflectionStability: 0, // 指针偏转平稳性 zeroDrift: 0, // 零位漂移 indicationError: 1, // 示值误差、回程误差、轻敲位移 }) // 校验规则 const rules = ref({ rangeUpper: [{ required: true, message: '量程上限不能为空', trigger: ['blur', 'change'] }], rangeLower: [{ required: true, message: '量程下限不能为空', trigger: ['blur', 'change'] }], rangeUnit: [{ required: true, message: '量程单位不能为空', trigger: ['blur', 'change'] }], points: [{ required: true, message: '检定点个数不能为空', trigger: ['blur', 'change'] }], generateWay: [{ required: true, message: '生成方式不能为空', trigger: ['blur', 'change'] }], measureMedium: [{ required: true, message: '检定介质不能为空', trigger: ['blur', 'change'] }], division: [{ required: true, message: '分度值的1/5不能为空', trigger: ['blur', 'change'] }], accuracyLevelLower: [{ required: true, message: '准确度等级(量程上限90%以下)不能为空', trigger: ['blur', 'change'] }], accuracyLevelUpper: [{ required: true, message: '准确度等级(量程上限90%及以上)不能为空', trigger: ['blur', 'change'] }], zeroPosition: [{ required: true, message: '零位是否带止销不能为空', trigger: ['blur', 'change'] }], accuracyLevel: [{ required: true, message: '准确度等级不能为空', trigger: ['blur', 'change'] }], supplyVoltage: [{ required: true, message: '供电电压不能为空', trigger: ['blur', 'change'] }], cycleNumber: [{ required: true, message: '循环次数不能为空', trigger: ['blur', 'change'] }], displayValueOne: [{ required: true, message: '标准器示值1不能为空', trigger: ['blur', 'change'] }], displayValueTwo: [{ required: true, message: '标准器示值2不能为空', trigger: ['blur', 'change'] }], displayValueThree: [{ required: true, message: '标准器示值3不能为空', trigger: ['blur', 'change'] }], theoreticalOutputValueUnit: [{ required: true, message: '理论输出值单位不能为空', trigger: ['blur', 'change'] }], }) // ----------------------------------------表头------------------------------------------------ const columns = ref([]) as any // 表头数据 const columns_piezometer = ref([ // 一般压力表、精密压力表、电接点一般压力表 { text: '标准器示值', value: 'indicatingValue', align: 'center', required: true, width: '220' }, { text: '检定介质', value: 'measureMedium', align: 'center', width: '120', required: true }, { text: '准确度等级', value: 'accuracyClass', align: 'center', width: '120', required: true }, { text: '最大允许误差', value: 'maximumError', align: 'center' }, { text: '回程误差允许值', value: 'returnError', align: 'center' }, { text: '轻敲位移允许值', value: 'frictionError', align: 'center', required: true }, { text: '示值误差允许值', value: 'indicatingError', align: 'center', required: true }, { text: '零位是/否带止销', value: 'zeroPosition', align: 'center', required: true }, ]) const columns_pressure_transmitter = ref([ // 压力变送器 { text: '标准器示值', value: 'indicatingValue', align: 'center', required: true, width: '220' }, { text: '理论输出值(mA)', value: 'theoreticalOutputValue', align: 'center', required: false }, { text: '示值误差允许误差', value: 'indicatingError', align: 'center', required: false }, { text: '回差允许误差', value: 'returnError', align: 'center', required: false }, ]) const columns_pressure_sensor = ref([ // 压力传感器 { text: '标准器示值', value: 'indicatingValue', align: 'center', required: true, width: '220' }, { text: '理论输出值(mA)', value: 'theoreticalOutputValue', align: 'center', required: true }, ]) const columns_digital_pressure_gauge = ref([ // 数字压力计 { text: '标准器示值', value: 'indicatingValue', align: 'center', required: true, width: '220' }, { text: '检定介质', value: 'measureMedium', align: 'center', width: '120', required: true }, { text: '准确度等级', value: 'accuracyClass', align: 'center', width: '120', required: true }, { text: '最大允许误差', value: 'maximumError', align: 'center' }, { text: '示值误差允许值', value: 'indicatingError', align: 'center', required: true }, { text: '回程误差允许值', value: 'returnError', align: 'center' }, ]) // ------------------------------------------字典---------------------------------------------- const generateWayList = ref<dictType[]>([]) // 生成方式 const measureMediumList = ref<dictType[]>([]) // 检定介质 const measureMediumMap = ref({}) as any // 检定介质 const accuracyLevelLowerMap = ref({}) as any // 准确度等级 const accuracyLevelLowerList = ref<dictType[]>([]) // 准确度等级(量程上限90%以下) const rangeUnitList = ref<dictType[]>([]) // 量程单位 const accuracyLevel_digitalPressureGaugeList = ref<dictType[]>([]) // 准确度等级-数字压力计 const accuracyLevel_precisioPressureGaugeList = ref<dictType[]>([]) // 准确度等级-精密压力表 const supplyVoltageUnitList = ref<dictType[]>([]) // 供电电压单位 const theoreticalOutputValueUnitList = ref<dictType[]>([]) // 理论输出值单位 /** * 获取字典 */ function getDict() { // 生成方式 getDictByCode('generateWay').then((response) => { generateWayList.value = response.data }) // 检定介质 getDictByCode('easureMedium').then((response) => { measureMediumList.value = response.data response.data.forEach((item: { value: string; name: string }) => { measureMediumMap.value[`${item.value}`] = item.name }) }) // 准确度等级(量程上限90%以下) getDictByCode('accuracyLevelLower').then((response) => { accuracyLevelLowerList.value = response.data response.data.forEach((item: { value: string; name: string }) => { accuracyLevelLowerMap.value[`${item.value}`] = item.name }) }) // 量程单位 getDictByCode('rangeUnit').then((response) => { rangeUnitList.value = response.data }) // 准确度等级-数字压力计 getDictByCode('accuracyLevel_digitalPressureGauge').then((response) => { accuracyLevel_digitalPressureGaugeList.value = response.data }) // 准确度等级-精密压力表 getDictByCode('accuracyLevel_precisioPressureGauge').then((response) => { accuracyLevel_precisioPressureGaugeList.value = response.data }) // 供电电压单位 getDictByCode('supplyVoltageUnit').then((response) => { supplyVoltageUnitList.value = response.data }) // 理论输出值单位 getDictByCode('standard4TheoreticalOutputValueUnit').then((response) => { theoreticalOutputValueUnitList.value = response.data }) } getDict() // ---------------------------------------------校验--------------------------------------------------- // 校验表格(点击保存的时候用、生成标准器示值) const checkList = () => { if (form.value.deviationAndSwitching && props.itemCategoryName === '电接点一般压力表') { if (`${form.value.displayValueOne}` === '') { ElMessage.warning('设定标准器示值1不能为空') return false } if (showValueTwo.value && `${form.value.displayValueTwo}` === '') { ElMessage.warning('设定标准器示值2不能为空') return false } if (showValueThree.value && `${form.value.displayValueThree}` === '') { ElMessage.warning('设定标准器示值3不能为空') return false } } if (!list.value.length) { ElMessage.warning('检定项表格不能为空') return false } if (!useCheckList(list.value, columns.value, '检定项表格')) { return false } ruleFormRef.value!.clearValidate() // 移除表单校验结果 ruleFormDeviationAndSwitchingRef.value!.clearValidate() return true } // ------------------------------------------------------------------------------------------------ /** * 计算理论输出值 * @param rangeLower 量程下限 * @param rangeUpper 量程上限 * @param indicatingValue 标准器示值、当前量程 */ function theoreticalOutput(rangeLower: number, rangeUpper: number, indicatingValue: number) { const rangeUpperSubRangeLower = calc(rangeUpper, rangeLower, '-') // 量程上限-下限 const indicatingValueSubrangeLower = calc(indicatingValue, rangeLower, '-') // 当前量程-下限 const multiResult = calc(rangeUpperSubRangeLower, indicatingValueSubrangeLower, '*') // 乘法结果 const result = calc(calc(16, multiResult, '/'), 4, '+') return Number(result).toFixed(3) } // 点击生成标准器示值 const calculateData = () => { if (form.value.rangeUpper === form.value.rangeLower) { ElMessage.warning('量程上限与下限不能完全相同') return } ruleFormDeviationAndSwitchingRef.value.validate((validOut: boolean) => { if (validOut) { ruleFormRef.value!.validate((valid: boolean) => { if (valid) { const params = { belongStandardEquipment: props.belongStandardEquipment, // 检校标准库 itemCategoryName: props.itemCategoryName, // 检定项分类名称 measureItemConfigPistonGauge: { ...form.value, itemId: props.itemId, // 检定项id appearance: form.value.appearance, // 外观 tightness: form.value.tightness, // 密封性 insulationResistance: form.value.insulationResistance, // 绝缘电阻 pointerDeflectionStability: form.value.pointerDeflectionStability, // 指针偏转平稳性 zeroDrift: form.value.zeroDrift, // 零位漂移 indicationError: form.value.indicationError, // 示值误差、回程误差、轻敲位移 }, } tableLoading.value = true calculate(params).then((res) => { list.value = res.data.map((item: IList, index: number) => { let indicatingValue = 0 // 计算标准器示值 if (list.value.length === 1) { // 检定点为1个,取量程下限 indicatingValue = form.value.rangeLower } else { const step = calc(Number(calc(form.value.rangeUpper, form.value.rangeLower, '-')), form.value.points - 1, '/') indicatingValue = Number(calc(form.value.rangeLower, calc(step, index, '*'), '+')) } return { ...item, zeroPosition: item.zeroPosition ? '是' : '否', // 零位是否带止销 indicatingValue: `${form.value.generateWay}` === '1' ? indicatingValue : '', // 平分点法取值标准器示值 } }) tableLoading.value = false }) } }) } }) } // 点击重新计算 const recalculateData = () => { if (props.itemCategoryName === '压力变送器' && !useCheckList(list.value, columns.value, '检定项表格')) { return false } ruleFormDeviationAndSwitchingRef.value!.validate((validOut: boolean) => { if (validOut) { ruleFormRef.value!.validate((valid: boolean) => { if (valid) { const params = { belongStandardEquipment: props.belongStandardEquipment, // 检校标准库 itemCategoryName: props.itemCategoryName, // 检定项分类名称 measureItemConfigPistonGauge: { ...form.value, itemId: props.itemId, // 检定项id appearance: form.value.appearance, // 外观 tightness: form.value.tightness, // 密封性 insulationResistance: form.value.insulationResistance, // 绝缘电阻 pointerDeflectionStability: form.value.pointerDeflectionStability, // 指针偏转平稳性 zeroDrift: form.value.zeroDrift, // 零位漂移 indicationError: form.value.indicationError, // 示值误差、回程误差、轻敲位移 deviationAndSwitching: form.value.deviationAndSwitching, // 设定点偏差及切换差 }, measureItemDataPistonGaugeList: list.value.map((item) => { return { ...item, zeroPosition: item.zeroPosition !== '否', theoreticalOutputValueUnit: form.value.theoreticalOutputValueUnit, } }), // 检定项数据 } tableLoading.value = true recalculate(params).then((res) => { list.value = res.data.map((item: IList, index: number) => { return { ...item, // measureMedium: measureMediumMap.value[`${item.measureMedium}`], // 检定介质 zeroPosition: item.zeroPosition ? '是' : '否', // 零位是否带止销 } }) tableLoading.value = false }) } }) } }) } // ----------------------------------------------电接点一般压力表--------------------------------- // 点击增加设定标准器示值 const addValue = () => { if (!showValueTwo.value) { showValueTwo.value = true } else { showValueThree.value = true } } // ----------------------------------------------------------------------------------------------------- watch(() => props.itemCategoryName, (newValue) => { if (newValue === '一般压力表' || newValue === '精密压力表' || newValue === '电接点一般压力表') { columns.value = columns_piezometer.value } else if (newValue === '压力变送器') { columns.value = columns_pressure_transmitter.value } else if (newValue === '压力传感器') { columns.value = columns_pressure_sensor.value } else if (newValue === '数字压力计') { columns.value = columns_digital_pressure_gauge.value } }, { immediate: true }) // 监听准确度等级(量程上限90%以下)和监听准确度等级(量程上限90%以上)对应关系 const accuracyLevelMap: { [key: string]: string } = { '1.0': '1.6', '1.6': '2.5', '2.5': '4.0', '4.0': '4.0', } // 监听准确度等级(量程上限90%以下)--修改以上 watch(() => form.value.accuracyLevelLower, (newValue) => { if (newValue) { form.value.accuracyLevelUpper = Number(accuracyLevelMap[newValue]) } }) const $route = useRoute() watch(() => props.list, (newVal) => { // 检定项表格 const updataOld = $route.query.updataOld as string // if (newVal && updataOld !== 'true') { if (newVal) { list.value = [...newVal] list.value = list.value.map((item) => { return { ...item, zeroPosition: `${item.zeroPosition}` === 'false' ? '否' : '是', } }) if (list.value.length) { form.value.theoreticalOutputValueUnit = list.value[0].theoreticalOutputValueUnit // 理论输出值单位 } } }) watch(() => props.form, (newVal) => { // 检定项表单 const updataOld = $route.query.updataOld as string if (newVal && Object.keys(newVal).length !== 0) { form.value.id = newVal.id // if (updataOld !== 'true') { form.value = { ...newVal } form.value.division = Number(newVal.division) // 分度值的1/5 form.value.supplyVoltage = Number(getDataNum(newVal.supplyVoltage)) // 供电电压 form.value.supplyVoltageUnit = getDataUnit(newVal.supplyVoltage) // 供电电压单位 if (form.value.displayValueTwo) { // 设定标准器示值2 showValueTwo.value = true } if (form.value.displayValueThree) { // 设定标准器示值3 showValueThree.value = true } // } } }, { deep: true, immediate: true }) // 监听切换理论输出值单位 const changeTheoreticalOutputValueUnit = (val: string) => { console.log(val) columns_pressure_transmitter.value[1].text = `理论输出值(${val})` } onMounted(() => { form.value.points = props.itemCategoryName === '压力变送器' ? 5 : props.itemCategoryName === '压力传感器' ? 6 : 3 form.value.cycleNumber = props.itemCategoryName === '压力变送器' || props.itemCategoryName === '压力传感器' ? 3 : props.itemCategoryName === '数字压力计' ? 2 : 0 }) defineExpose({ list, form, checkList }) </script> <template> <div class="template-detail-fourth"> <div style="padding: 0 10px 20px;"> <el-checkbox v-model="form.appearance" :false-label="0" :true-label="1" :disabled="pageType === 'detail'"> 外观 </el-checkbox> <el-checkbox v-model="form.tightness" :false-label="0" :true-label="1" :disabled="pageType === 'detail'"> 密封性 </el-checkbox> <el-checkbox v-model="form.insulationResistance" :false-label="0" :true-label="1" :disabled="pageType === 'detail'"> 绝缘电阻 </el-checkbox> <el-checkbox v-model="form.pointerDeflectionStability" :false-label="0" :true-label="1" :disabled="pageType === 'detail'"> 指针偏转平稳性 </el-checkbox> <el-checkbox v-model="form.zeroDrift" :false-label="0" :true-label="1" :disabled="pageType === 'detail' || props.itemCategoryName !== '数字压力计'"> 零位漂移 </el-checkbox><br> <el-checkbox v-if="props.itemCategoryName === '电接点一般压力表' || props.itemCategoryName === '一般压力表' || props.itemCategoryName === '精密压力表'" v-model="form.indicationError" :false-label="0" :true-label="1" disabled> 示值误差、回程误差、轻敲位移 </el-checkbox> <el-checkbox v-if="props.itemCategoryName === '压力变送器' || props.itemCategoryName === '数字压力计'" v-model="form.indicationError" :false-label="0" :true-label="1" disabled> 示值误差 </el-checkbox> <el-checkbox v-if="props.itemCategoryName === '压力传感器'" v-model="form.indicationError" :false-label="0" :true-label="1" disabled> 检定数据 </el-checkbox> </div> <el-form ref="ruleFormRef" :model="form" label-width="130" label-position="right" :rules="rules" > <el-row :gutter="24"> <el-col :span="12" style="display: flex;justify-content: flex-start;"> <el-form-item label="量程:" prop="rangeLower"> <precision-input-number v-model="form.rangeLower" :placeholder="pageType === 'detail' ? '' : '量程下限'" :disabled="pageType === 'detail'" style="flex: 1;" /> </el-form-item> <span style="margin-left: 10px;">——</span> <el-form-item label-width="10" prop="rangeUpper"> <precision-input-number v-model="form.rangeUpper" :placeholder="pageType === 'detail' ? '' : '量程上限'" :disabled="pageType === 'detail'" style="flex: 1;" :min="form.rangeLower" /> </el-form-item> <el-form-item label-width="10" prop="rangeUnit"> <!-- 单位 --> <el-select v-model="form.rangeUnit" placeholder="单位" :disabled="props.pageType === 'detail'" filterable style="width: 100px;" > <el-option v-for="item in rangeUnitList" :key="item.id" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="检定点个数:" prop="points"> <el-input-number v-model="form.points" :placeholder="pageType === 'detail' ? '' : '请输入检定点个数'" :disabled="pageType === 'detail'" :step="1" :min="3" :max="20" :precision="0" class="full-width-input" /> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="生成方式:" prop="generateWay"> <el-select v-model="form.generateWay" placeholder="生成方式" :disabled="props.pageType === 'detail'" filterable class="full-width-input" > <el-option v-for="item in generateWayList" :key="item.id" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> <el-col :span="6"> <el-form-item label="检定介质:" prop="measureMedium"> <el-select v-model="form.measureMedium" placeholder="检定介质" :disabled="props.pageType === 'detail'" filterable class="full-width-input" > <el-option v-for="item in measureMediumList" :key="item.id" :label="item.name" :value="item.name" /> </el-select> </el-form-item> </el-col> <el-col v-if="props.itemCategoryName === '一般压力表' || props.itemCategoryName === '电接点一般压力表' || props.itemCategoryName === '精密压力表'" :span="6"> <el-form-item :label="props.itemCategoryName === '精密压力表' ? '分度值的1/10:' : '分度值的1/5:'" prop="division"> <precision-input-number v-model="form.division" :placeholder="pageType === 'detail' ? '' : '请输入分度值的1/5'" :disabled="pageType === 'detail'" :min="0" class="full-width-input" /> </el-form-item> </el-col> <el-col v-if="props.itemCategoryName === '一般压力表' || props.itemCategoryName === '电接点一般压力表'" :span="6"> <el-form-item label-width="220" label="准确度等级(量程上限90%以下):" prop="accuracyLevelLower"> <el-select v-model="form.accuracyLevelLower" placeholder="请选择" :disabled="props.pageType === 'detail'" filterable class="full-width-input" > <el-option v-for="item in accuracyLevelLowerList" :key="item.id" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> <!-- 循环次数(压力变送器、压力传感器、数字压力计) --> <el-col v-if="props.itemCategoryName === '压力变送器' || props.itemCategoryName === '压力传感器' || props.itemCategoryName === '数字压力计'" :span="6"> <el-form-item label="循环次数:" prop="cycleNumber"> <el-input-number v-model="form.cycleNumber" :placeholder="pageType === 'detail' ? '' : '请输入循环次数'" :disabled="pageType === 'detail'" :step="1" :min="1" :precision="0" class="full-width-input" /> </el-form-item> </el-col> <el-col v-if="props.itemCategoryName === '一般压力表' || props.itemCategoryName === '电接点一般压力表' " :span="6"> <el-form-item label="准确度等级(量程上限90%及以上):" prop="accuracyLevelUpper"> <precision-input-number v-model="form.accuracyLevelUpper" :placeholder="pageType === 'detail' ? '' : '请输入'" :disabled="pageType === 'detail'" :min="0" class="full-width-input" /> </el-form-item> </el-col> <!-- 准确度等级(精密压力表) --> <el-col v-if="props.itemCategoryName === '精密压力表'" :span="6"> <el-form-item label="准确度等级:" prop="accuracyLevel"> <el-select v-model="form.accuracyLevel" placeholder="准确度等级" :disabled="props.pageType === 'detail'" filterable class="full-width-input" > <el-option v-for="item in accuracyLevel_precisioPressureGaugeList" :key="item.id" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> <!-- 准确度等级(数字压力计) --> <el-col v-if="props.itemCategoryName === '数字压力计'" :span="6"> <el-form-item label="准确度等级:" prop="accuracyLevel"> <el-select v-model="form.accuracyLevel" placeholder="准确度等级" :disabled="props.pageType === 'detail'" filterable class="full-width-input" > <el-option v-for="item in accuracyLevel_digitalPressureGaugeList" :key="item.id" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> <!-- 准确度等级(压力变送器、压力传感器) --> <el-col v-if="props.itemCategoryName === '压力变送器' || props.itemCategoryName === '压力传感器' " :span="6"> <el-form-item label="准确度等级:" prop="accuracyLevel"> <precision-input-number v-model="form.accuracyLevel" :placeholder="pageType === 'detail' ? '' : '请输入'" :disabled="pageType === 'detail'" :min="0" class="full-width-input" /> </el-form-item> </el-col> <el-col v-if="props.itemCategoryName === '一般压力表' || props.itemCategoryName === '电接点一般压力表' || props.itemCategoryName === '精密压力表'" :span="6"> <el-form-item label="零位是否带止销:" prop="zeroPosition"> <el-radio-group v-model="form.zeroPosition" class="full-width-input" :disabled="props.pageType === 'detail'"> <el-radio :label="true" size="large"> 是 </el-radio> <el-radio :label="false" size="large"> 否 </el-radio> </el-radio-group> </el-form-item> </el-col> <el-col v-if="props.itemCategoryName === '压力变送器'" :span="6"> <el-form-item label="理论输出值单位:" prop="theoreticalOutputValueUnit"> <el-select v-model="form.theoreticalOutputValueUnit" placeholder="理论输出值单位" :disabled="props.pageType === 'detail'" filterable class="full-width-input" @change="changeTheoreticalOutputValueUnit" > <el-option v-for="item in theoreticalOutputValueUnitList" :key="item.id" :label="item.name" :value="item.name" /> </el-select> </el-form-item> </el-col> <!-- 供电电压 --> <el-col v-if="props.itemCategoryName === '压力传感器'" :span="12" style="display: flex;justify-content: flex-start;"> <el-form-item label="供电电压:" prop="supplyVoltage"> <precision-input-number v-model="form.supplyVoltage" :placeholder="pageType === 'detail' ? '' : '请选择供电电压'" :disabled="pageType === 'detail'" style="flex: 1;" /> </el-form-item> <el-form-item label-width="10" prop="supplyVoltageUnit"> <!-- 单位 --> <el-select v-if="props.pageType !== 'detail'" v-model="form.supplyVoltageUnit" placeholder="单位" :disabled="props.pageType === 'detail'" filterable style="width: 100px;" > <el-option v-for="item in supplyVoltageUnitList" :key="item.id" :label="item.name" :value="item.value" /> </el-select> </el-form-item> </el-col> <!-- <el-col v-if="props.itemCategoryName === '压力传感器'" :span="6"> <el-form-item label="上一周期灵敏度b0:" prop="lastCycleSensitivity"> <el-input v-model="form.lastCycleSensitivity" class="full-width-input" autosize type="textarea" disabled /> </el-form-item> </el-col> --> </el-row> </el-form> <detail-block :title="props.pageType !== 'detail' ? ' ' : ''"> <template v-if="props.pageType !== 'detail'" #btns> <el-button type="primary" @click="calculateData"> 生成标准器示值 </el-button> <el-button v-if="props.itemCategoryName === '一般压力表' || props.itemCategoryName === '压力变送器' || props.itemCategoryName === '压力传感器' || props.itemCategoryName === '电接点一般压力表'" type="primary" @click="recalculateData"> 计算结果 </el-button> </template> <el-table ref="tableRef" v-loading="tableLoading" :data="list" border style="width: 100%;" > <el-table-column align="center" label="序号" width="80" type="index" /> <el-table-column v-for="item in columns" :key="item.value" :prop="item.value" :label="item.text" :width="item.width" align="center" > <template #header> <span v-show="item.required" style="color: red;">*</span><span>{{ item.text }}</span> </template> <template #default="scope"> <precision-input-number v-if="props.pageType !== 'detail' && item.value === 'indicatingValue'" v-model="scope.row[item.value]" :placeholder="pageType === 'detail' ? '' : '标准器示值'" :disabled="pageType === 'detail'" class="full-width-input" :min="form.rangeLower" :max="form.rangeUpper" /> </template> </el-table-column> </el-table> </detail-block> <el-checkbox v-if="props.itemCategoryName === '电接点一般压力表'" v-model="form.deviationAndSwitching" :false-label="0" :true-label="1" :disabled="pageType === 'detail'"> 设定点偏差及切换差 </el-checkbox><br> <el-form ref="ruleFormDeviationAndSwitchingRef" :model="form" label-width="130" label-position="right" :rules="rules" > <el-row v-if="props.itemCategoryName === '电接点一般压力表' && form.deviationAndSwitching" :gutter="24" style="margin-top: 20px;"> <el-col :span="8"> <el-form-item label-width="140" label="设定标准器示值1:" prop="displayValueOne"> <div style="display: flex;flex-wrap: nowrap;"> <el-input v-model="form.displayValueOne" :placeholder="pageType === 'detail' ? '' : '请设定标准器示值'" :disabled="pageType === 'detail'" :class="{ 'detail-input': pageType === 'detail' }" style="flex: 1;" /> <icon-button v-if="!showValueTwo && pageType !== 'detail'" style="margin-left: 10px;" size="20" icon="icon-add" title="新建" type="primary" @click="addValue" /> </div> </el-form-item> </el-col> <el-col v-if="showValueTwo" :span="8"> <el-form-item label-width="140" label="设定标准器示值2:" prop="displayValueTwo"> <div style="display: flex;flex-wrap: nowrap;"> <el-input v-model="form.displayValueTwo" :placeholder="pageType === 'detail' ? '' : '请设定标准器示值'" :disabled="pageType === 'detail'" :class="{ 'detail-input': pageType === 'detail' }" style="flex: 1;" /> <icon-button v-if="!showValueThree && pageType !== 'detail'" style="margin-left: 10px;" size="20" icon="icon-add" title="新建" type="primary" @click="addValue" /> </div> </el-form-item> </el-col> <el-col v-if="showValueThree" :span="8"> <el-form-item label-width="140" label="设定标准器示值3:" prop="displayValueThree"> <div style="display: flex;flex-wrap: nowrap;"> <el-input v-model="form.displayValueThree" :placeholder="pageType === 'detail' ? '' : '请设定标准器示值'" :disabled="pageType === 'detail'" :class="{ 'detail-input': pageType === 'detail' }" style="flex: 1;" /> <!-- <icon-button v-if="!showValueThree && pageType !== 'detail'" style="margin-left: 10px;" size="20" icon="icon-add" title="新建" type="primary" @click="addValue" /> --> </div> </el-form-item> </el-col> </el-row> </el-form> </div> </template> <style lang="scss"> .template-detail-fourth { .el-radio__label { display: block !important; } } </style>