import config from "../config"

export default {
    list: {
        url: config.base_dev_url + "farm/list?key="+config.mini_key,
        type: "get",
    },
    weatherRiskVirtualFarmList: {
        url: config.base_dev_url + "farm/weatherRiskVirtualFarmList?key="+config.mini_key,
        type: "get",
    },
    getTimeLine: {
        url: config.base_dev_url + "fairyland/getNodesByFarmId?key="+config.mini_key,
        type: "get",
    },
    getReportData: {
        url: config.base_dev_url + "fairyland/predict?key="+config.mini_key,
        type: "post",
    },
    getCataclysmTimeLine: {
        url: config.base_dev_url + "fairyland/getDisasterNodesByFarmId?key="+config.mini_key,
        type: "get",
    },
    getCataclysmReportData: {
        url: config.base_dev_url + "fairyland/disasterPredict?key="+config.mini_key,
        type: "post",
    },
    getDisasterJudgment: {
        url: config.base_dev_url + "fairyland/disasterJudgment?key="+config.mini_key,
        type: "post",
    },
    fetchFarmDetail: {
        url: config.base_dev_url + "farm/getById?key="+config.mini_key,
        type: "get",
    },
    fetchFarmWorkList: {
        url: config.base_url +"farm_work/list",
        type: "get",
    },
    fetchFarmImgs: {
        url: config.base_dev_url + "image/list?key="+config.mini_key,
        type: "post",
    },
    getLiveStart: {
        url: config.base_dev_url + "farm/liveStart?key="+config.mini_key,
        type: "get",
    },
    getUserNewFarm: {
        url: config.base_dev_url + "farm/getUserNewFarm?key="+config.mini_key,
        type: "get",
    },
    fetchFarmLog: {
        url: config.base_dev_url + "farm/vrOrchardContent?key="+config.mini_key,
        type: "post",
    },
    fetchExpertFarmList: {
        url: config.base_dev_url + "t_expert/expertFarmList?key="+config.mini_key,
        type: "get",
    },
    pesticideFertilizers:{
        url: config.base_dev_url + "z_farm_work_order/pesticideFertilizers?key="+config.mini_key,
        type: "get",
    },
    fetchWorkList: {
        url: config.base_dev_url + "z_farm_work_order/list?key="+config.mini_key,
        type: "get",
    },
    blueRegionList: {
        url: config.base_dev_url + "farm/blueRegionList?key="+config.mini_key,
        type: "get",
    },
    confirm:{
        url: config.base_dev_url + "z_farm_work_order/confirm?key="+config.mini_key,
        type: "post",
    },
    farmIndexReport: {
        url: config.base_dev_url + "farm/farmIndexReport?key="+config.mini_key,
        type: "get"
    },
    saveFarmWork: {
        url: config.base_url + "z_farm_work_order/save",
        type: "post",
    },
    deleteFarmWork: {
        url: config.base_dev_url + "z_farm_work_order/delete?key="+config.mini_key,
        type: "get",
    },
    getSpeciesItemList: {
        url: config.base_dev_url + "lz_sample/speciesItemList?key="+config.mini_key,
        type: "get",
        mockCondition: (p)=>{
            return p.farmId === 90888 || p.farmId === 26196 || p.farmId === 766 || p.farmId === 80865;
        },mockFun:function(p){
            return new Promise((resolve, reject) => {
                //柏桥
                if(p.farmId === 90888 || p.farmId === 26196 || p.farmId === 766 || p.farmId === 80865){
                    resolve({
                        "code": 0,
                        "msg": "success",
                        "data": [
                            {
                                "color": "#0000FF",
                                "mu": 7.1900005,
                                "sampleCount": "146",
                                "speciesItemId": "3",
                                "speciesItemName": "井岗红糯"
                            },
                            {
                                "color": "#00FF00",
                                "mu": 1.7299994,
                                "sampleCount": "34",
                                "speciesItemId": "2",
                                "speciesItemName": "糯米糍"
                            },
                            {
                                "color": "#FF0000",
                                "mu": 0.32999998,
                                "sampleCount": "7",
                                "speciesItemId": "1",
                                "speciesItemName": "桂味"
                            },
                            {
                                "color": "#C0C0C0",
                                "mu": 0.25,
                                "sampleCount": "5",
                                "speciesItemId": "7",
                                "speciesItemName": "岭丰糯"
                            },
                            {
                                "color": "#00FFFF",
                                "mu": 0.11,
                                "sampleCount": "2",
                                "speciesItemId": "5",
                                "speciesItemName": "怀枝"
                            }
                        ],
                        "extData": null,
                        "success": true
                    })
                }
            })
        }
    },
    getFarmFiles: {
        url: config.base_url + "farm/getFarmFiles",
        type: "get",
        mockCondition: (p)=>{
            // return p.farmId === 90888 || p.farmId === 26196 || p.farmId === 766 || p.farmId === 80865;
            return p.farmId === 91702;
        },mockFun:function(p){
            return new Promise((resolve, reject) => {
                if(p.farmId === 91702){
                    resolve({
                        "code": 0,
                        "msg": "",
                        "data": [
                            {
                                "production_info": {
                                    "production": 1244,
                                    "cihua_ratio": 75,
                                    "quality": 96.47
                                },
                                "type_id": 0,
                                "meta_info": {
                                    "avg_age": "--",
                                    "prescription_info": {
                                        "statement": "近期农事复核良好",
                                        "key": "农事"
                                    },
                                    "avg_branch_num": 81,
                                    "avg_crown": 13.4,
                                    "phenology_info": {
                                        "statement": "2025年4月3日，进入小果期",
                                        "key": "物候"
                                    },
                                    "grow_alert_info": {
                                        "statement": "近期无异常",
                                        "key": "异常"
                                    },
                                    "dp_alert_info": {
                                        "statement": "近期无病虫害爆发",
                                        "key": "病虫"
                                    }
                                },
                                "ecology_info": {
                                    "ventilation": 91,
                                    "transmittance": 94,
                                    "dp_situation": 0
                                }
                            },
                            {
                                "production_info": {
                                    "production": 1844,
                                    "cihua_ratio": 75,
                                    "quality": 86.4796108551076
                                },
                                "type_id": 12,
                                "meta_info": {
                                    "avg_age": 10,
                                    "prescription_info": {
                                        "statement": "近期农事复核良好",
                                        "key": "农事"
                                    },
                                    "avg_branch_num": 346,
                                    "avg_crown": 43.4,
                                    "phenology_info": {
                                        "statement": "近期无异常",
                                        "key": "物候"
                                    },
                                    "grow_alert_info": {
                                        "statement": "近期无异常",
                                        "key": "异常"
                                    },
                                    "dp_alert_info": {
                                        "statement": "近期无病虫害爆发",
                                        "key": "病虫"
                                    }
                                },
                                "ecology_info": {
                                    "ventilation": 61,
                                    "transmittance": 54,
                                    "dp_situation": 9
                                }
                            }
                        ],
                        "extData": null,
                        "success": true
                    })
                }//郑旭果园
            })
        }
    },
    fetchLegendList: {
        url: config.base_url + "lz_sample/legendList",
        type: "get",
    },
}

