|
@@ -198,26 +198,51 @@ function getFileData(farmId, regionId) {
|
|
|
if(!farmId){
|
|
if(!farmId){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- VE_API.farm.getFarmFiles({ farmId, regionId: regionId ? regionId : undefined }).then(({ data }) => {
|
|
|
|
|
- console.log("111",data)
|
|
|
|
|
|
|
+ VE_API.farm.getFarmFiles({ farmId, regionId: regionId ? regionId : undefined }).then(({ data, extData }) => {
|
|
|
allTypeData.value = data;
|
|
allTypeData.value = data;
|
|
|
console.log("getFileData", allTypeData.value);
|
|
console.log("getFileData", allTypeData.value);
|
|
|
- setFileData(photoBaseData.value[0].speciesItemId);
|
|
|
|
|
|
|
+ setFileData(photoBaseData.value[0].speciesItemId, extData);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-function setFileData(type_id) {
|
|
|
|
|
- if(!type_id){
|
|
|
|
|
- type_id = "0"
|
|
|
|
|
- }
|
|
|
|
|
- const res = allTypeData.value.find((item) => item.type_id == type_id);
|
|
|
|
|
- if(res.production_info.zuoguo_ratio && res.production_info.zuoguo_ratio > 30){
|
|
|
|
|
- res.production_info.zuoguo_ratio = res.production_info.zuoguo_ratio * 0.15
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- photoBaseData.value[1].value = res.meta_info.avg_crown + "平方米";
|
|
|
|
|
- photoBaseData.value[2].value = res.meta_info.avg_branch_num;
|
|
|
|
|
- photoBaseData.value[3].value = res.meta_info.avg_age + "年";
|
|
|
|
|
|
|
+function setFileData(type_id, filesDict) {
|
|
|
|
|
+ if(!type_id){
|
|
|
|
|
+ type_id = "0"
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = allTypeData.value.find((item) => item.type_id == type_id);
|
|
|
|
|
+ let i = 1;
|
|
|
|
|
+ for(let key of Object.keys(res.meta_info)){
|
|
|
|
|
+ let dict = filesDict.find((item) => item.field == key)
|
|
|
|
|
+ if(dict){
|
|
|
|
|
+ photoBaseData.value[i].label = dict.label
|
|
|
|
|
+ photoBaseData.value[i].value = res.meta_info[dict.field] + dict.unit
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ i = 0;
|
|
|
|
|
+ for(let key of Object.keys(res.production_info)){
|
|
|
|
|
+ let dict = filesDict.find((item) => item.field == key)
|
|
|
|
|
+ if(dict){
|
|
|
|
|
+ outputBox.value[i].name = dict.label
|
|
|
|
|
+ outputBox.value[i].value = res.production_info[dict.field]
|
|
|
|
|
+ outputBox.value[i].unit = dict.unit
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ i = 0;
|
|
|
|
|
+ for(let key of Object.keys(res.ecology_info)){
|
|
|
|
|
+ let dict = filesDict.find((item) => item.field == key)
|
|
|
|
|
+ if(dict){
|
|
|
|
|
+ qualityBox.value[i].name = dict.label
|
|
|
|
|
+ qualityBox.value[i].value = res.ecology_info[dict.field]
|
|
|
|
|
+ qualityBox.value[i].unit = dict.unit
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
photoList.value[0].key = res.meta_info.phenology_info.key;
|
|
photoList.value[0].key = res.meta_info.phenology_info.key;
|
|
|
photoList.value[0].statement = res.meta_info.phenology_info.statement;
|
|
photoList.value[0].statement = res.meta_info.phenology_info.statement;
|
|
|
photoList.value[1].key = res.meta_info.dp_alert_info.key;
|
|
photoList.value[1].key = res.meta_info.dp_alert_info.key;
|
|
@@ -226,22 +251,6 @@ function setFileData(type_id) {
|
|
|
photoList.value[2].statement = res.meta_info.grow_alert_info.statement;
|
|
photoList.value[2].statement = res.meta_info.grow_alert_info.statement;
|
|
|
photoList.value[3].key = res.meta_info.prescription_info.key;
|
|
photoList.value[3].key = res.meta_info.prescription_info.key;
|
|
|
photoList.value[3].statement = res.meta_info.prescription_info.statement;
|
|
photoList.value[3].statement = res.meta_info.prescription_info.statement;
|
|
|
- // if(res.production_info.production){
|
|
|
|
|
- // res.production_info.production = (res.production_info.production * 1.3).toFixed(1)
|
|
|
|
|
- // }
|
|
|
|
|
- outputBox.value[0].value = res.production_info.production;
|
|
|
|
|
- outputBox.value[1].value = res.production_info.quality.toFixed(0);
|
|
|
|
|
- if(res.production_info.zuoguo_ratio){
|
|
|
|
|
- outputBox.value[2].name = "坐果率";
|
|
|
|
|
- outputBox.value[2].value = res.production_info.zuoguo_ratio.toFixed(0);
|
|
|
|
|
-
|
|
|
|
|
- }else{
|
|
|
|
|
- outputBox.value[2].name = "雌花率";
|
|
|
|
|
- outputBox.value[2].value = res.production_info.cihua_ratio.toFixed(0);
|
|
|
|
|
- }
|
|
|
|
|
- qualityBox.value[0].value = res.ecology_info.ventilation;
|
|
|
|
|
- qualityBox.value[1].value = res.ecology_info.transmittance;
|
|
|
|
|
- qualityBox.value[2].value = res.ecology_info.dp_situation;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 可拖拽
|
|
// 可拖拽
|