fix:检测项执行采集数据方法并填入数据
This commit is contained in:
parent
1c67395b24
commit
f7cd216f7c
|
|
@ -65,7 +65,6 @@
|
|||
<el-input-number
|
||||
v-if="item.testitem_field_type=='input-number'"
|
||||
v-model="scope.row[item.testitem_name]"
|
||||
:min="0"
|
||||
:disabled="!scope.row.isEdit||!item.canEdit"
|
||||
class="width-100"
|
||||
controls-position="right"
|
||||
|
|
@ -858,32 +857,24 @@ export default {
|
|||
obj.isEdit = true;
|
||||
that.mlogbwlist.splice(index,1);
|
||||
that.wprInputText = "";
|
||||
console.log('that.setForm',that.setForm);
|
||||
that.mlogbwlist.unshift(obj);
|
||||
if(that.setForm.cd_req_addr!==null){
|
||||
//执行cd_req_addr,获取检测设备的数据
|
||||
console.log('that.setForm.cd_req_addr',that.setForm.cd_req_addr);
|
||||
let res = mockData[0];
|
||||
console.log('mockres',res);
|
||||
// that.$API.system.eq_info_get.req({}).then((res) => {
|
||||
//例:res:{x:2.5,y:3.5,z:5.0}
|
||||
let x = res.x;
|
||||
let y = res.y;
|
||||
let z = res.z;
|
||||
that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
|
||||
//例:res:[{"ZValue": "-0.18", "machineId": "testMachine","XValue": "-127.5831","YValue": "-12.5523"}]
|
||||
let x = res.XValue;
|
||||
let y = res.YValue;
|
||||
let z = res.ZValue;
|
||||
//遍历检测项,查看是否有cd_expr
|
||||
that.qct_testitems.forEach(item0 => {
|
||||
let str = "x>y?x:y"
|
||||
obj[item0.testitem_name] = eval(str);
|
||||
// if(item0.cd_expr!=null){
|
||||
// //例:cd_expr:"x>y?x:y"
|
||||
// obj[item0.testitem_name] = eval(item0.cd_expr);
|
||||
// }
|
||||
if(item0.testitem_cd_expr!=null){
|
||||
that.mlogbwlist[0][item0.testitem_name]= eval(item0.testitem_cd_expr);
|
||||
}
|
||||
})
|
||||
that.mlogbwlist.unshift(obj);
|
||||
// }).catch((err) => {
|
||||
// return err;
|
||||
// });
|
||||
}else{
|
||||
that.mlogbwlist.unshift(obj);
|
||||
|
||||
}).catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue