|
|
@@ -162,38 +162,51 @@ function toggleActiveImg(index) {
|
|
|
const getSampleFiles = (geoHash) => {
|
|
|
// photoList.value = [];
|
|
|
const farmId = sessionStorage.getItem("farmId");
|
|
|
- VE_API.mini_farm.getSampleFiles({ geoHashSample: geoHash,farmId }).then(({data}) => {
|
|
|
+ VE_API.mini_farm.getSampleFiles({ geoHashSample: geoHash,farmId }).then(({data,extData}) => {
|
|
|
photoBaseData.value[0].value = data.meta_info.type_id;
|
|
|
- let pj = "--"
|
|
|
- if(data.meta_info.crown){
|
|
|
- pj = Math.sqrt(data.meta_info.crown * 1.2).toFixed(1);
|
|
|
+ let i = 1;
|
|
|
+ for(let key of Object.keys(data.meta_info)){
|
|
|
+ let dict = extData.find((item) => item.field == key)
|
|
|
+ if(dict){
|
|
|
+ photoBaseData.value[i].label = dict.label
|
|
|
+ if(dict.field === "crown"){
|
|
|
+ photoBaseData.value[i].value = data.meta_info[dict.field]
|
|
|
+ let pj = Math.sqrt(photoBaseData.value[i].value * 1.2).toFixed(1);
|
|
|
+ photoBaseData.value[i].value = photoBaseData.value[i].value + dict.unit + "(蓬径"+pj+"米)";
|
|
|
+ }else{
|
|
|
+ photoBaseData.value[i].value = data.meta_info[dict.field] + dict.unit
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ i = 0;
|
|
|
+ for(let key of Object.keys(data.production_info)){
|
|
|
+ let dict = extData.find((item) => item.field == key)
|
|
|
+ if(dict){
|
|
|
+ outputBox.value[i].name = dict.label
|
|
|
+ outputBox.value[i].value = data.production_info[dict.field] + dict.unit
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ i = 0;
|
|
|
+ for(let key of Object.keys(data.ecology_info)){
|
|
|
+ let dict = extData.find((item) => item.field == key)
|
|
|
+ if(dict){
|
|
|
+ qualityBox.value[i].name = dict.label
|
|
|
+ qualityBox.value[i].value = data.ecology_info[dict.field] + dict.unit
|
|
|
+ i++;
|
|
|
+ }
|
|
|
}
|
|
|
- photoBaseData.value[1].value = data.meta_info.crown + "平方米(蓬径"+pj+"米)";
|
|
|
- photoBaseData.value[2].value = data.meta_info.branch_num ;
|
|
|
|
|
|
- photoBaseData.value[3].value = data.meta_info.age + "年"
|
|
|
- photoList.value[0].key = data.meta_info.dp_alert_info.key
|
|
|
- photoList.value[0].statement = data.meta_info.dp_alert_info.statement
|
|
|
- photoList.value[1].key = data.meta_info.grow_alert_info.key
|
|
|
- photoList.value[1].statement = data.meta_info.grow_alert_info.statement
|
|
|
- photoList.value[2].key = data.meta_info.nutrition_info.key
|
|
|
- photoList.value[2].statement = data.meta_info.nutrition_info.statement
|
|
|
- photoList.value[3].key = data.meta_info.prescription_info.key
|
|
|
- photoList.value[3].statement = data.meta_info.prescription_info.statement
|
|
|
- // if(data.production_info.production){
|
|
|
- // data.production_info.production = (data.production_info.production * 1.3).toFixed(1)
|
|
|
- // }
|
|
|
- outputBox.value[0].value = data.production_info.production + "斤"
|
|
|
- outputBox.value[1].value = data.production_info.quality.toFixed(0) + "%"
|
|
|
- if(data.production_info.cihua_ratio){
|
|
|
- outputBox.value[2].value = (100 - parseInt(data.production_info.cihua_ratio)).toFixed(0) + "%"
|
|
|
- }else{
|
|
|
- outputBox.value[2].name = "坐果率"
|
|
|
- outputBox.value[2].value = parseInt(data.production_info.zuoguo_ratio).toFixed(0)+ "%"
|
|
|
- }
|
|
|
- qualityBox.value[0].value = data.ecology_info.ventilation + "%"
|
|
|
- qualityBox.value[1].value = data.ecology_info.transmittance + "%"
|
|
|
- qualityBox.value[2].value = data.ecology_info.dp_situation+"%"
|
|
|
+ photoList.value[0].key = data.meta_info.dp_alert_info.key
|
|
|
+ photoList.value[0].statement = data.meta_info.dp_alert_info.statement
|
|
|
+ photoList.value[1].key = data.meta_info.grow_alert_info.key
|
|
|
+ photoList.value[1].statement = data.meta_info.grow_alert_info.statement
|
|
|
+ photoList.value[2].key = data.meta_info.nutrition_info.key
|
|
|
+ photoList.value[2].statement = data.meta_info.nutrition_info.statement
|
|
|
+ photoList.value[3].key = data.meta_info.prescription_info.key
|
|
|
+ photoList.value[3].statement = data.meta_info.prescription_info.statement
|
|
|
});
|
|
|
};
|
|
|
|