|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form ref="formData" :rules="formRules" :model="formData" size="mini" :disabled="checkShow" label-width="80px">
|
|
|
+ <el-form ref="formRef" :rules="formRules" :model="formData" size="mini" :disabled="checkShow" label-width="80px">
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
<el-form-item label="发动机型号" prop="engineModel" label-width="95px">
|
|
|
<el-select v-model="formData.engineModel" placeholder="请选择发动机型号" @change="changeEngine">
|
|
@@ -27,8 +27,8 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<el-form ref="formData" :disabled="checkShow" :model="formData" :rules="formRules" size="mini" label-width="80px">
|
|
|
- <el-form-item label="测量批次" prop="measurementBatch" style="margin-left: 5%">
|
|
|
- <el-select v-model="formData.measurementBatch" placeholder="请选择测量批次">
|
|
|
+ <el-form-item label="测量批次" prop="measurementBatchId" style="margin-left: 5%">
|
|
|
+ <el-select v-model="formData.measurementBatchId" placeholder="请选择测量批次">
|
|
|
<el-option v-for="item in batchOption" :key="item.id" :label="item.measurementBatch" :value="item.id">
|
|
|
</el-option>
|
|
|
<el-option :value="undefined" disabled style="cursor: pointer">
|
|
@@ -39,7 +39,7 @@
|
|
|
</el-form>
|
|
|
<div class="box">
|
|
|
<span class="title">环境参数</span>
|
|
|
- <el-form :disabled="checkShow" :rules="formRules" ref="formData" :model="formData" size="mini" label-width="80px" :validate-on-rule-change="false">
|
|
|
+ <el-form :disabled="checkShow" :rules="formRules" ref="formRef" :model="formData" size="mini" label-width="80px" :validate-on-rule-change="false">
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
<el-form-item label="发动机状态" label-width="100px" prop="engineStatus">
|
|
|
<el-select v-model="formData.engineStatus" placeholder="请选择发动机状态">
|
|
@@ -105,8 +105,7 @@
|
|
|
</div>
|
|
|
<div class="box" v-if="radiationData && Object.keys(radiationData).length > 0">
|
|
|
<span class="title">光谱辐射测量数据</span>
|
|
|
- <el-form :rules="radiationRules" :key="radiationData.createTime" :disabled="checkShow || addBtn"
|
|
|
- ref="radiationData" size="mini" :model="radiationData" label-width="80px">
|
|
|
+ <el-form :rules="radiationRules" :key="radiationData.createTime" :disabled="checkShow || addBtn" :validate-on-rule-change="false" ref="radiationRef" size="mini" :model="radiationData" label-width="80px">
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
<el-form-item label="型号" prop="model">
|
|
|
<el-input v-model="radiationData.model" placeholder="请输入型号" />
|
|
@@ -151,8 +150,7 @@
|
|
|
</el-form>
|
|
|
<div class="box" style="margin-bottom: 15px">
|
|
|
<span class="title">目标数据</span>
|
|
|
- <el-form ref="radiationData" :disabled="checkShow || addBtn" size="mini" :rules="radiationRules"
|
|
|
- :model="radiationData" label-width="80px">
|
|
|
+ <el-form ref="radiationRef" :disabled="checkShow || addBtn" size="mini" :rules="radiationRules" :validate-on-rule-change="false" :model="radiationData" label-width="80px">
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
<el-form-item label="原始数据" prop="rawData">
|
|
|
<file-upload :isCheck="isCheck" :fileSize="0" :limit="5" :fileType="['txt']"
|
|
@@ -172,8 +170,8 @@
|
|
|
</div>
|
|
|
<div class="box" v-if="TIData && Object.keys(TIData).length > 0">
|
|
|
<span class="title">热像仪测量数据</span>
|
|
|
- <el-form ref="TIData" :disabled="checkShow || addBtn" :rules="TIRules" :key="TIData.createTime" :model="TIData"
|
|
|
- size="mini" label-width="80px">
|
|
|
+ <el-form ref="TIRef" :disabled="checkShow || addBtn" :rules="TIRules" :key="TIData.createTime" :model="TIData"
|
|
|
+ size="mini" label-width="80px" :validate-on-rule-change="false">
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
<el-form-item label="型号" prop="model">
|
|
|
<el-input v-model="TIData.model" placeholder="请输入型号" />
|
|
@@ -231,7 +229,7 @@
|
|
|
</div>
|
|
|
<div class="box" v-if="TransmittanceData">
|
|
|
<span class="title">透过率数据</span>
|
|
|
- <el-form :disabled="checkShow || addBtn" ref="TransmittanceData" :model="TransmittanceData" label-width="80px">
|
|
|
+ <el-form :disabled="checkShow || addBtn" ref="TransmittanceRef" :model="TransmittanceData" label-width="80px" :validate-on-rule-change="false">
|
|
|
<el-row type="flex" justify="space-around">
|
|
|
<el-form-item label="原始数据" prop="rawData">
|
|
|
<file-upload :fileSize="0" :limit="1" :isCheck="isCheck" :fileType="['txt']"
|
|
@@ -248,13 +246,13 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <div v-if="!isCheck" slot="footer" class="footerBtn">
|
|
|
+ <div v-if="footShow" slot="footer" class="footerBtn">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
<el-button @click="cancel" style="margin-left: 40px;">取 消</el-button>
|
|
|
</div>
|
|
|
<el-dialog :close-on-click-modal="false" title="增加标定温度" :visible.sync="addCalTempVisible" width="500px"
|
|
|
append-to-body>
|
|
|
- <el-form ref="calTempForm" :model="calTempForm" label-width="60px">
|
|
|
+ <el-form ref="calTempFormRef" :model="calTempForm" label-width="60px">
|
|
|
<el-form-item label="温度" prop="temp">
|
|
|
<el-input type="number" v-model.number="calTempForm.temp" placeholder="请输入温度(只能输入数字)" />
|
|
|
</el-form-item>
|
|
@@ -270,7 +268,7 @@
|
|
|
</el-dialog>
|
|
|
<el-dialog :close-on-click-modal="false" title="增加发动机型号" :visible.sync="addDialogVisible" width="400px"
|
|
|
append-to-body>
|
|
|
- <el-form ref="addEngineForm" :model="addEngineForm" :disabled="isCheck" :rules="rules" label-width="100px">
|
|
|
+ <el-form ref="addEngineFormRef" :model="addEngineForm" :disabled="isCheck" :rules="rules" label-width="100px">
|
|
|
<el-form-item label="发动机型号" prop="model">
|
|
|
<el-input v-model="addEngineForm.model" placeholder="请输入发动机型号" />
|
|
|
</el-form-item>
|
|
@@ -287,7 +285,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<el-dialog :close-on-click-modal="false" title="增加测量批次" :visible.sync="addMeasVisible" width="400px" append-to-body>
|
|
|
- <el-form ref="form" :model="addMeasBatchForm" :rules="rules" label-width="110px">
|
|
|
+ <el-form ref="formRef" :model="addMeasBatchForm" :rules="rules" label-width="110px">
|
|
|
<el-form-item label="发动机型号" prop="engineId">
|
|
|
<el-select v-model="addMeasBatchForm.engineId" placeholder="请选择发动机型号" @change="engineChange">
|
|
|
<el-option v-for="item in engineOptions" :key="item.id" :label="item.model" :value="item.id">
|
|
@@ -307,7 +305,7 @@
|
|
|
</el-dialog>
|
|
|
<el-dialog :close-on-click-modal="false" title="增加发动机状态" :visible.sync="addStatusVisible" width="400px"
|
|
|
append-to-body>
|
|
|
- <el-form ref="addStatusForm" :model="addStatusForm" :rules="rules" label-width="80px">
|
|
|
+ <el-form ref="addStatusFormRef" :model="addStatusForm" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-input v-model="addStatusForm.status" placeholder="请输入状态" />
|
|
|
</el-form-item>
|
|
@@ -322,7 +320,7 @@
|
|
|
</el-dialog>
|
|
|
<el-dialog :close-on-click-modal="false" title="增加发动机角度" :visible.sync="addAngleVisible" width="400px"
|
|
|
append-to-body>
|
|
|
- <el-form ref="addAngleForm" :model="addAngleForm" :rules="rules" label-width="80px">
|
|
|
+ <el-form ref="addAngleFormRef" :model="addAngleForm" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="角度" prop="angle">
|
|
|
<el-input v-model="addAngleForm.angle" placeholder="请输入角度" />
|
|
|
</el-form-item>
|
|
@@ -376,6 +374,10 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false,
|
|
|
},
|
|
|
+ footShow:{
|
|
|
+ type: Boolean,
|
|
|
+ default: true,
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -548,6 +550,11 @@ export default {
|
|
|
radiationForm: {
|
|
|
handler(newVal) {
|
|
|
this.radiationData = newVal;
|
|
|
+ if(newVal && newVal.calTemp){
|
|
|
+ this.calTempData=JSON.parse(newVal.calTemp)
|
|
|
+ }else{
|
|
|
+ this.calTempData=[]
|
|
|
+ }
|
|
|
},
|
|
|
immediate: true,
|
|
|
deep: true
|
|
@@ -578,15 +585,12 @@ export default {
|
|
|
},
|
|
|
immediate: true
|
|
|
},
|
|
|
- calTempData: {
|
|
|
+ footShow: {
|
|
|
handler(newVal) {
|
|
|
- if (this.radiationForm) {
|
|
|
- this.radiationForm.calTemp = this.calTempData.length>0?JSON.stringify(newVal):null;
|
|
|
- }
|
|
|
+ this.footShow = newVal;
|
|
|
},
|
|
|
- immediate: true,
|
|
|
- deep: true
|
|
|
- }
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
getFileName(name) {
|
|
@@ -653,7 +657,7 @@ export default {
|
|
|
// 获取发电机List
|
|
|
getListEngineModel() {
|
|
|
this.loading = true;
|
|
|
- const data = {};
|
|
|
+ const data = {pageNum:1,pageSize:10000};
|
|
|
listEngineModel(data).then((response) => {
|
|
|
this.engineOptions = response.rows;
|
|
|
this.loading = false;
|
|
@@ -661,11 +665,13 @@ export default {
|
|
|
},
|
|
|
// 获取测量批次List
|
|
|
getListMeasBatch() {
|
|
|
- const data = {};
|
|
|
+ const data = {pageNum:1,pageSize:10000};
|
|
|
this.loading = true;
|
|
|
listMeasBatch(data).then((response) => {
|
|
|
this.measureBatchOptions = response.rows;
|
|
|
- this.batchOption = this.measureBatchOptions.filter(item => { return item.engineModel === this.form.engineModel });
|
|
|
+ if(this.form.engineModel){
|
|
|
+ this.batchOption = this.measureBatchOptions.filter(item => { return item.engineModel === this.form.engineModel });
|
|
|
+ }
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
@@ -690,8 +696,12 @@ export default {
|
|
|
else if (type === "measBatch")
|
|
|
{
|
|
|
if (this.form.engineModel) {
|
|
|
- this.addMeasBatchForm.engineId = this.form.engineModel
|
|
|
- this.engineChange(this.form.engineModel)
|
|
|
+ let obj = {};
|
|
|
+ obj = this.engineOptions.find((item) => {
|
|
|
+ return item.model === this.form.engineModel;
|
|
|
+ });
|
|
|
+ this.addMeasBatchForm.engineId = obj.id
|
|
|
+ this.engineChange(obj.id)
|
|
|
}
|
|
|
this.addMeasVisible = true;
|
|
|
}
|
|
@@ -701,7 +711,7 @@ export default {
|
|
|
engineChange(val) {
|
|
|
let obj = {};
|
|
|
obj = this.engineOptions.find((item) => {
|
|
|
- return item.model === val;
|
|
|
+ return item.id === val;
|
|
|
});
|
|
|
this.addMeasBatchForm.measurementBatch = this.getTime() + '-' + obj?.model
|
|
|
},
|
|
@@ -723,13 +733,14 @@ export default {
|
|
|
});
|
|
|
this.form.geometryFiles = obj?.geometryFiles
|
|
|
this.form.geometryImage = obj?.geometryImage
|
|
|
- this.batchOption = this.measureBatchOptions.filter(item => { return item.engineModel === val })
|
|
|
+ this.batchOption = this.measureBatchOptions.filter(item => { return item.engineId === val })
|
|
|
},
|
|
|
addCalTemp() {
|
|
|
this.resetCalTempForm()
|
|
|
this.addCalTempVisible = true
|
|
|
},
|
|
|
submitCalTemp() {
|
|
|
+ console.log("this.calTempData",this.calTempData);
|
|
|
this.calTempData.push(this.calTempForm)
|
|
|
this.addCalTempVisible = false
|
|
|
this.resetCalTempForm()
|
|
@@ -751,30 +762,37 @@ export default {
|
|
|
},
|
|
|
// 环境参数保存
|
|
|
envDataSave() {
|
|
|
- this.$refs.formData.validate()
|
|
|
+ this.$refs.formRef.validate()
|
|
|
.then(()=>{
|
|
|
- this.$emit('env-data-save', this.$refs["form"])
|
|
|
+ this.$emit('env-data-save')
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- this.$message.error(`检验错误!`);
|
|
|
+ console.log("err",err);
|
|
|
+ this.$message.error(`错误信息`,err);
|
|
|
});
|
|
|
|
|
|
},
|
|
|
validateAll() {
|
|
|
return Promise.all([
|
|
|
- this.$refs.formData.validate(),
|
|
|
- this.$refs.radiationData.validate(),
|
|
|
- this.$refs.TIData.validate(),
|
|
|
- this.$refs.TransmittanceData.validate()
|
|
|
+ this.$refs.formRef?.validate(),
|
|
|
+ this.$refs.radiationRef?.validate(),
|
|
|
+ this.$refs.TIRef?.validate(),
|
|
|
+ this.$refs.TransmittanceRef?.validate()
|
|
|
]);
|
|
|
},
|
|
|
submitForm() {
|
|
|
this.validateAll()
|
|
|
.then(() => {
|
|
|
+ if (this.radiationForm) {
|
|
|
+ console.log("this.calTempData.length",this.calTempData.length);
|
|
|
+ this.radiationForm.calTemp = this.calTempData.length>0?JSON.stringify(this.calTempData):null;
|
|
|
+ this.calTempData=[]
|
|
|
+ }
|
|
|
this.$emit('submit-form');
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
- this.$message.error(`检验错误!`);
|
|
|
+ console.log("err",err);
|
|
|
+ this.$message.error(`错误信息`,err);
|
|
|
});
|
|
|
},
|
|
|
isObjectEqual(obj1, obj2) {
|