farm.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. const config = require("../config")
  2. module.exports = {
  3. list: {
  4. url: config.base_dev_url + "farm/list?key="+config.mini_key,
  5. type: "get",
  6. },
  7. weatherRiskVirtualFarmList: {
  8. url: config.base_dev_url + "farm/weatherRiskVirtualFarmList?key="+config.mini_key,
  9. type: "get",
  10. },
  11. getTimeLine: {
  12. url: config.base_dev_url + "fairyland/getNodesByFarmId?key="+config.mini_key,
  13. type: "get",
  14. },
  15. getReportData: {
  16. url: config.base_dev_url + "fairyland/predict?key="+config.mini_key,
  17. type: "post",
  18. },
  19. getCataclysmTimeLine: {
  20. url: config.base_dev_url + "fairyland/getDisasterNodesByFarmId?key="+config.mini_key,
  21. type: "get",
  22. },
  23. getCataclysmReportData: {
  24. url: config.base_dev_url + "fairyland/disasterPredict?key="+config.mini_key,
  25. type: "post",
  26. },
  27. getDisasterJudgment: {
  28. url: config.base_dev_url + "fairyland/disasterJudgment?key="+config.mini_key,
  29. type: "post",
  30. },
  31. fetchFarmDetail: {
  32. url: config.base_dev_url + "farm/getById?key="+config.mini_key,
  33. type: "get",
  34. },
  35. fetchFarmWorkList: {
  36. url: config.base_url +"farm_work/list",
  37. type: "get",
  38. },
  39. fetchFarmImgs: {
  40. url: config.base_dev_url + "image/list?key="+config.mini_key,
  41. type: "post",
  42. },
  43. getLiveStart: {
  44. url: config.base_dev_url + "farm/liveStart?key="+config.mini_key,
  45. type: "get",
  46. },
  47. getUserNewFarm: {
  48. url: config.base_dev_url + "farm/getUserNewFarm?key="+config.mini_key,
  49. type: "get",
  50. },
  51. fetchFarmLog: {
  52. url: config.base_dev_url + "farm/vrOrchardContent?key="+config.mini_key,
  53. type: "post",
  54. },
  55. fetchExpertFarmList: {
  56. url: config.base_dev_url + "t_expert/expertFarmList?key="+config.mini_key,
  57. type: "get",
  58. },
  59. pesticideFertilizers:{
  60. url: config.base_dev_url + "z_farm_work_order/pesticideFertilizers?key="+config.mini_key,
  61. type: "get",
  62. },
  63. fetchWorkList: {
  64. url: config.base_dev_url + "z_farm_work_order/list?key="+config.mini_key,
  65. type: "get",
  66. },
  67. blueRegionList: {
  68. url: config.base_dev_url + "farm/blueRegionList?key="+config.mini_key,
  69. type: "get",
  70. },
  71. confirm:{
  72. url: config.base_dev_url + "z_farm_work_order/confirm?key="+config.mini_key,
  73. type: "post",
  74. },
  75. farmIndexReport: {
  76. url: config.base_dev_url + "farm/farmIndexReport?key="+config.mini_key,
  77. type: "get"
  78. },
  79. saveFarmWork: {
  80. url: config.base_url + "z_farm_work_order/save",
  81. type: "post",
  82. },
  83. deleteFarmWork: {
  84. url: config.base_dev_url + "z_farm_work_order/delete?key="+config.mini_key,
  85. type: "get",
  86. },
  87. getSpeciesItemList: {
  88. url: config.base_dev_url + "lz_sample/speciesItemList?key="+config.mini_key,
  89. type: "get",
  90. mockCondition: (p)=>{
  91. return p.farmId === 90888 || p.farmId === 26196 || p.farmId === 766 || p.farmId === 80865;
  92. },mockFun:function(p){
  93. return new Promise((resolve, reject) => {
  94. //柏桥
  95. if(p.farmId === 90888 || p.farmId === 26196 || p.farmId === 766 || p.farmId === 80865){
  96. resolve({
  97. "code": 0,
  98. "msg": "success",
  99. "data": [
  100. {
  101. "color": "#0000FF",
  102. "mu": 7.1900005,
  103. "sampleCount": "146",
  104. "speciesItemId": "3",
  105. "speciesItemName": "井岗红糯"
  106. },
  107. {
  108. "color": "#00FF00",
  109. "mu": 1.7299994,
  110. "sampleCount": "34",
  111. "speciesItemId": "2",
  112. "speciesItemName": "糯米糍"
  113. },
  114. {
  115. "color": "#FF0000",
  116. "mu": 0.32999998,
  117. "sampleCount": "7",
  118. "speciesItemId": "1",
  119. "speciesItemName": "桂味"
  120. },
  121. {
  122. "color": "#C0C0C0",
  123. "mu": 0.25,
  124. "sampleCount": "5",
  125. "speciesItemId": "7",
  126. "speciesItemName": "岭丰糯"
  127. },
  128. {
  129. "color": "#00FFFF",
  130. "mu": 0.11,
  131. "sampleCount": "2",
  132. "speciesItemId": "5",
  133. "speciesItemName": "怀枝"
  134. }
  135. ],
  136. "extData": null,
  137. "success": true
  138. })
  139. }
  140. })
  141. }
  142. },
  143. getFarmFiles: {
  144. url: config.base_url + "farm/getFarmFiles",
  145. type: "get",
  146. mockCondition: (p)=>{
  147. // return p.farmId === 90888 || p.farmId === 26196 || p.farmId === 766 || p.farmId === 80865;
  148. return p.farmId === 91702;
  149. },mockFun:function(p){
  150. return new Promise((resolve, reject) => {
  151. if(p.farmId === 26196){
  152. resolve({
  153. "code": 0,
  154. "msg": "",
  155. "data": [
  156. {
  157. "production_info": {
  158. "production": 1244,
  159. "cihua_ratio": 75,
  160. "zuoguo_ratio": 10,
  161. "quality": 96.47
  162. },
  163. "type_id": 0,
  164. "meta_info": {
  165. "avg_age": 5,
  166. "prescription_info": {
  167. "statement": "近期农事复核良好",
  168. "key": "农事"
  169. },
  170. "avg_branch_num": 81,
  171. "avg_crown": 13.4,
  172. "phenology_info": {
  173. "statement": "2025年4月1日,进入小果期",
  174. "key": "物候"
  175. },
  176. "grow_alert_info": {
  177. "statement": "近期无异常",
  178. "key": "异常"
  179. },
  180. "dp_alert_info": {
  181. "statement": "近期无病虫害爆发",
  182. "key": "病虫"
  183. }
  184. },
  185. "ecology_info": {
  186. "ventilation": 91,
  187. "transmittance": 94,
  188. "dp_situation": 0
  189. }
  190. },
  191. {
  192. "production_info": {
  193. "production": 1844,
  194. "cihua_ratio": 25,
  195. "quality": 86.4796108551076
  196. },
  197. "type_id": 12,
  198. "meta_info": {
  199. "avg_age": 10,
  200. "prescription_info": {
  201. "statement": "近期农事复核良好",
  202. "key": "农事"
  203. },
  204. "avg_branch_num": 346,
  205. "avg_crown": 43.4,
  206. "phenology_info": {
  207. "statement": "近期无异常",
  208. "key": "物候"
  209. },
  210. "grow_alert_info": {
  211. "statement": "近期无异常",
  212. "key": "异常"
  213. },
  214. "dp_alert_info": {
  215. "statement": "近期无病虫害爆发",
  216. "key": "病虫"
  217. }
  218. },
  219. "ecology_info": {
  220. "ventilation": 61,
  221. "transmittance": 54,
  222. "dp_situation": 9
  223. }
  224. }
  225. ],
  226. "extData": null,
  227. "success": true
  228. })
  229. }//荔枝先生
  230. if(p.farmId === 80865){
  231. resolve({
  232. "code": 0,
  233. "msg": "",
  234. "data": [
  235. {
  236. "production_info": {
  237. "production": 1244,
  238. "cihua_ratio": 75,
  239. "quality": 96.47
  240. },
  241. "type_id": 0,
  242. "meta_info": {
  243. "avg_age": "--",
  244. "prescription_info": {
  245. "statement": "近期农事复核良好",
  246. "key": "农事"
  247. },
  248. "avg_branch_num": 81,
  249. "avg_crown": 13.4,
  250. "phenology_info": {
  251. "statement": "2025年4月3日,进入小果期",
  252. "key": "物候"
  253. },
  254. "grow_alert_info": {
  255. "statement": "近期无异常",
  256. "key": "异常"
  257. },
  258. "dp_alert_info": {
  259. "statement": "近期无病虫害爆发",
  260. "key": "病虫"
  261. }
  262. },
  263. "ecology_info": {
  264. "ventilation": 91,
  265. "transmittance": 94,
  266. "dp_situation": 0
  267. }
  268. },
  269. {
  270. "production_info": {
  271. "production": 1844,
  272. "cihua_ratio": 75,
  273. "quality": 86.4796108551076
  274. },
  275. "type_id": 12,
  276. "meta_info": {
  277. "avg_age": 10,
  278. "prescription_info": {
  279. "statement": "近期农事复核良好",
  280. "key": "农事"
  281. },
  282. "avg_branch_num": 346,
  283. "avg_crown": 43.4,
  284. "phenology_info": {
  285. "statement": "近期无异常",
  286. "key": "物候"
  287. },
  288. "grow_alert_info": {
  289. "statement": "近期无异常",
  290. "key": "异常"
  291. },
  292. "dp_alert_info": {
  293. "statement": "近期无病虫害爆发",
  294. "key": "病虫"
  295. }
  296. },
  297. "ecology_info": {
  298. "ventilation": 61,
  299. "transmittance": 54,
  300. "dp_situation": 9
  301. }
  302. }
  303. ],
  304. "extData": null,
  305. "success": true
  306. })
  307. }//柏桥
  308. if(p.farmId === 91702){
  309. resolve({
  310. "code": 0,
  311. "msg": "",
  312. "data": [
  313. {
  314. "production_info": {
  315. "production": 1244,
  316. "cihua_ratio": 75,
  317. "quality": 96.47
  318. },
  319. "type_id": 0,
  320. "meta_info": {
  321. "avg_age": "--",
  322. "prescription_info": {
  323. "statement": "近期农事复核良好",
  324. "key": "农事"
  325. },
  326. "avg_branch_num": 81,
  327. "avg_crown": 13.4,
  328. "phenology_info": {
  329. "statement": "2025年4月3日,进入小果期",
  330. "key": "物候"
  331. },
  332. "grow_alert_info": {
  333. "statement": "近期无异常",
  334. "key": "异常"
  335. },
  336. "dp_alert_info": {
  337. "statement": "近期无病虫害爆发",
  338. "key": "病虫"
  339. }
  340. },
  341. "ecology_info": {
  342. "ventilation": 91,
  343. "transmittance": 94,
  344. "dp_situation": 0
  345. }
  346. },
  347. {
  348. "production_info": {
  349. "production": 1844,
  350. "cihua_ratio": 75,
  351. "quality": 86.4796108551076
  352. },
  353. "type_id": 12,
  354. "meta_info": {
  355. "avg_age": 10,
  356. "prescription_info": {
  357. "statement": "近期农事复核良好",
  358. "key": "农事"
  359. },
  360. "avg_branch_num": 346,
  361. "avg_crown": 43.4,
  362. "phenology_info": {
  363. "statement": "近期无异常",
  364. "key": "物候"
  365. },
  366. "grow_alert_info": {
  367. "statement": "近期无异常",
  368. "key": "异常"
  369. },
  370. "dp_alert_info": {
  371. "statement": "近期无病虫害爆发",
  372. "key": "病虫"
  373. }
  374. },
  375. "ecology_info": {
  376. "ventilation": 61,
  377. "transmittance": 54,
  378. "dp_situation": 9
  379. }
  380. }
  381. ],
  382. "extData": null,
  383. "success": true
  384. })
  385. }//郑旭果园
  386. })
  387. }
  388. },
  389. fetchLegendList: {
  390. url: config.base_url + "lz_sample/legendList",
  391. type: "get",
  392. },
  393. }