farm.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  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 === 90888 || p.farmId === 26196;
  149. },mockFun:function(p){
  150. return new Promise((resolve, reject) => {
  151. //柏桥
  152. if(p.farmId === 90888){
  153. resolve({
  154. "code": 0,
  155. "msg": "",
  156. "data": [
  157. {
  158. "production_info": {
  159. "production": 1244,
  160. "zuoguo_ratio": 25,
  161. "cihua_ratio": 25,
  162. "quality": 96.47
  163. },
  164. "type_id": 0,
  165. "meta_info": {
  166. "avg_age": "--",
  167. "prescription_info": {
  168. "statement": "近期农事复核良好",
  169. "key": "农事"
  170. },
  171. "avg_branch_num": 81,
  172. "avg_crown": 13.4,
  173. "phenology_info": {
  174. "statement": "近期无异常",
  175. "key": "物候"
  176. },
  177. "grow_alert_info": {
  178. "statement": "近期无异常",
  179. "key": "异常"
  180. },
  181. "dp_alert_info": {
  182. "statement": "近期无病虫害爆发",
  183. "key": "病虫"
  184. }
  185. },
  186. "ecology_info": {
  187. "ventilation": 91,
  188. "transmittance": 94,
  189. "dp_situation": 0
  190. }
  191. },
  192. {
  193. "production_info": {
  194. "production": 1844,
  195. "cihua_ratio": 25,
  196. "quality": 86.4796108551076
  197. },
  198. "type_id": 12,
  199. "meta_info": {
  200. "avg_age": 5,
  201. "prescription_info": {
  202. "statement": "近期农事复核良好",
  203. "key": "农事"
  204. },
  205. "avg_branch_num": 346,
  206. "avg_crown": 43.4,
  207. "phenology_info": {
  208. "statement": "近期无异常",
  209. "key": "物候"
  210. },
  211. "grow_alert_info": {
  212. "statement": "近期无异常",
  213. "key": "异常"
  214. },
  215. "dp_alert_info": {
  216. "statement": "近期无病虫害爆发",
  217. "key": "病虫"
  218. }
  219. },
  220. "ecology_info": {
  221. "ventilation": 61,
  222. "transmittance": 54,
  223. "dp_situation": 9
  224. }
  225. }
  226. ],
  227. "extData": null,
  228. "success": true
  229. })
  230. }
  231. if(p.farmId === 26196){
  232. resolve({
  233. "code": 0,
  234. "msg": "",
  235. "data": [
  236. {
  237. "production_info": {
  238. "production": 1244,
  239. "cihua_ratio": 75,
  240. "zuoguo_ratio": 75,
  241. "quality": 96.47
  242. },
  243. "type_id": 0,
  244. "meta_info": {
  245. "avg_age": 5,
  246. "prescription_info": {
  247. "statement": "近期农事复核良好",
  248. "key": "农事"
  249. },
  250. "avg_branch_num": 81,
  251. "avg_crown": 13.4,
  252. "phenology_info": {
  253. "statement": "2025年4月1日,进入小果期",
  254. "key": "物候"
  255. },
  256. "grow_alert_info": {
  257. "statement": "近期无异常",
  258. "key": "异常"
  259. },
  260. "dp_alert_info": {
  261. "statement": "近期无病虫害爆发",
  262. "key": "病虫"
  263. }
  264. },
  265. "ecology_info": {
  266. "ventilation": 91,
  267. "transmittance": 94,
  268. "dp_situation": 0
  269. }
  270. },
  271. {
  272. "production_info": {
  273. "production": 1844,
  274. "cihua_ratio": 25,
  275. "quality": 86.4796108551076
  276. },
  277. "type_id": 12,
  278. "meta_info": {
  279. "avg_age": 10,
  280. "prescription_info": {
  281. "statement": "近期农事复核良好",
  282. "key": "农事"
  283. },
  284. "avg_branch_num": 346,
  285. "avg_crown": 43.4,
  286. "phenology_info": {
  287. "statement": "近期无异常",
  288. "key": "物候"
  289. },
  290. "grow_alert_info": {
  291. "statement": "近期无异常",
  292. "key": "异常"
  293. },
  294. "dp_alert_info": {
  295. "statement": "近期无病虫害爆发",
  296. "key": "病虫"
  297. }
  298. },
  299. "ecology_info": {
  300. "ventilation": 61,
  301. "transmittance": 54,
  302. "dp_situation": 9
  303. }
  304. }
  305. ],
  306. "extData": null,
  307. "success": true
  308. })
  309. }//荔枝先生
  310. if(p.farmId === 766){
  311. resolve({
  312. "code": 0,
  313. "msg": "",
  314. "data": [
  315. {
  316. "production_info": {
  317. "production": 1244,
  318. "cihua_ratio": 75,
  319. "quality": 96.47
  320. },
  321. "type_id": 0,
  322. "meta_info": {
  323. "avg_age": "--",
  324. "prescription_info": {
  325. "statement": "近期农事复核良好",
  326. "key": "农事"
  327. },
  328. "avg_branch_num": 81,
  329. "avg_crown": 13.4,
  330. "phenology_info": {
  331. "statement": "2025年4月15日,进入小果期",
  332. "key": "物候"
  333. },
  334. "grow_alert_info": {
  335. "statement": "近期无异常",
  336. "key": "异常"
  337. },
  338. "dp_alert_info": {
  339. "statement": "近期无病虫害爆发",
  340. "key": "病虫"
  341. }
  342. },
  343. "ecology_info": {
  344. "ventilation": 91,
  345. "transmittance": 94,
  346. "dp_situation": 0
  347. }
  348. },
  349. {
  350. "production_info": {
  351. "production": 1844,
  352. "cihua_ratio": 75,
  353. "quality": 86.4796108551076
  354. },
  355. "type_id": 12,
  356. "meta_info": {
  357. "avg_age": 10,
  358. "prescription_info": {
  359. "statement": "近期农事复核良好",
  360. "key": "农事"
  361. },
  362. "avg_branch_num": 346,
  363. "avg_crown": 43.4,
  364. "phenology_info": {
  365. "statement": "近期无异常",
  366. "key": "物候"
  367. },
  368. "grow_alert_info": {
  369. "statement": "近期无异常",
  370. "key": "异常"
  371. },
  372. "dp_alert_info": {
  373. "statement": "近期无病虫害爆发",
  374. "key": "病虫"
  375. }
  376. },
  377. "ecology_info": {
  378. "ventilation": 61,
  379. "transmittance": 54,
  380. "dp_situation": 9
  381. }
  382. }
  383. ],
  384. "extData": null,
  385. "success": true
  386. })
  387. }//荔博园
  388. if(p.farmId === 80865){
  389. resolve({
  390. "code": 0,
  391. "msg": "",
  392. "data": [
  393. {
  394. "production_info": {
  395. "production": 1244,
  396. "cihua_ratio": 75,
  397. "quality": 96.47
  398. },
  399. "type_id": 0,
  400. "meta_info": {
  401. "avg_age": "--",
  402. "prescription_info": {
  403. "statement": "近期农事复核良好",
  404. "key": "农事"
  405. },
  406. "avg_branch_num": 81,
  407. "avg_crown": 13.4,
  408. "phenology_info": {
  409. "statement": "2025年4月3日,进入小果期",
  410. "key": "物候"
  411. },
  412. "grow_alert_info": {
  413. "statement": "近期无异常",
  414. "key": "异常"
  415. },
  416. "dp_alert_info": {
  417. "statement": "近期无病虫害爆发",
  418. "key": "病虫"
  419. }
  420. },
  421. "ecology_info": {
  422. "ventilation": 91,
  423. "transmittance": 94,
  424. "dp_situation": 0
  425. }
  426. },
  427. {
  428. "production_info": {
  429. "production": 1844,
  430. "cihua_ratio": 75,
  431. "quality": 86.4796108551076
  432. },
  433. "type_id": 12,
  434. "meta_info": {
  435. "avg_age": 10,
  436. "prescription_info": {
  437. "statement": "近期农事复核良好",
  438. "key": "农事"
  439. },
  440. "avg_branch_num": 346,
  441. "avg_crown": 43.4,
  442. "phenology_info": {
  443. "statement": "近期无异常",
  444. "key": "物候"
  445. },
  446. "grow_alert_info": {
  447. "statement": "近期无异常",
  448. "key": "异常"
  449. },
  450. "dp_alert_info": {
  451. "statement": "近期无病虫害爆发",
  452. "key": "病虫"
  453. }
  454. },
  455. "ecology_info": {
  456. "ventilation": 61,
  457. "transmittance": 54,
  458. "dp_situation": 9
  459. }
  460. }
  461. ],
  462. "extData": null,
  463. "success": true
  464. })
  465. }//柏桥
  466. })
  467. }
  468. },
  469. fetchLegendList: {
  470. url: config.base_url + "lz_sample/legendList",
  471. type: "get",
  472. },
  473. }