fix:检测项执行采集数据方法并填入数据
This commit is contained in:
parent
1c67395b24
commit
f7cd216f7c
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue