fix:检测项执行采集数据方法并填入数据

This commit is contained in:
shijing 2025-02-27 14:26:20 +08:00
parent 1c67395b24
commit f7cd216f7c
1 changed files with 13 additions and 22 deletions

View File

@ -65,7 +65,6 @@
<el-input-number <el-input-number
v-if="item.testitem_field_type=='input-number'" v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]" v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit||!item.canEdit" :disabled="!scope.row.isEdit||!item.canEdit"
class="width-100" class="width-100"
controls-position="right" controls-position="right"
@ -858,32 +857,24 @@ export default {
obj.isEdit = true; obj.isEdit = true;
that.mlogbwlist.splice(index,1); that.mlogbwlist.splice(index,1);
that.wprInputText = ""; that.wprInputText = "";
console.log('that.setForm',that.setForm); that.mlogbwlist.unshift(obj);
if(that.setForm.cd_req_addr!==null){ if(that.setForm.cd_req_addr!==null){
//cd_req_addr, //cd_req_addr,
console.log('that.setForm.cd_req_addr',that.setForm.cd_req_addr); that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
let res = mockData[0]; //res:[{"ZValue": "-0.18", "machineId": "testMachine","XValue": "-127.5831","YValue": "-12.5523"}]
console.log('mockres',res); let x = res.XValue;
// that.$API.system.eq_info_get.req({}).then((res) => { let y = res.YValue;
//res:{x:2.5,y:3.5,z:5.0} let z = res.ZValue;
let x = res.x;
let y = res.y;
let z = res.z;
//cd_expr //cd_expr
that.qct_testitems.forEach(item0 => { that.qct_testitems.forEach(item0 => {
let str = "x>y?x:y" if(item0.testitem_cd_expr!=null){
obj[item0.testitem_name] = eval(str); that.mlogbwlist[0][item0.testitem_name]= eval(item0.testitem_cd_expr);
// if(item0.cd_expr!=null){ }
// //cd_expr:"x>y?x:y"
// obj[item0.testitem_name] = eval(item0.cd_expr);
// }
}) })
that.mlogbwlist.unshift(obj);
// }).catch((err) => { }).catch((err) => {
// return err; return err;
// }); });
}else{
that.mlogbwlist.unshift(obj);
} }
} }
}) })