farm.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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 || p.farmId === 26196){
  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": 10,
  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. "quality": 96.47
  241. },
  242. "type_id": 0,
  243. "meta_info": {
  244. "avg_age": "--",
  245. "prescription_info": {
  246. "statement": "近期农事复核良好",
  247. "key": "农事"
  248. },
  249. "avg_branch_num": 81,
  250. "avg_crown": 13.4,
  251. "phenology_info": {
  252. "statement": "2025年4月1日,进入小果期",
  253. "key": "物候"
  254. },
  255. "grow_alert_info": {
  256. "statement": "近期无异常",
  257. "key": "异常"
  258. },
  259. "dp_alert_info": {
  260. "statement": "近期无病虫害爆发",
  261. "key": "病虫"
  262. }
  263. },
  264. "ecology_info": {
  265. "ventilation": 91,
  266. "transmittance": 94,
  267. "dp_situation": 0
  268. }
  269. },
  270. {
  271. "production_info": {
  272. "production": 1844,
  273. "cihua_ratio": 25,
  274. "quality": 86.4796108551076
  275. },
  276. "type_id": 12,
  277. "meta_info": {
  278. "avg_age": 10,
  279. "prescription_info": {
  280. "statement": "近期农事复核良好",
  281. "key": "农事"
  282. },
  283. "avg_branch_num": 346,
  284. "avg_crown": 43.4,
  285. "phenology_info": {
  286. "statement": "近期无异常",
  287. "key": "物候"
  288. },
  289. "grow_alert_info": {
  290. "statement": "近期无异常",
  291. "key": "异常"
  292. },
  293. "dp_alert_info": {
  294. "statement": "近期无病虫害爆发",
  295. "key": "病虫"
  296. }
  297. },
  298. "ecology_info": {
  299. "ventilation": 61,
  300. "transmittance": 54,
  301. "dp_situation": 9
  302. }
  303. }
  304. ],
  305. "extData": null,
  306. "success": true
  307. })
  308. }//荔枝先生
  309. if(p.farmId === 766){
  310. resolve({
  311. "code": 0,
  312. "msg": "",
  313. "data": [
  314. {
  315. "production_info": {
  316. "production": 1244,
  317. "cihua_ratio": 75,
  318. "quality": 96.47
  319. },
  320. "type_id": 0,
  321. "meta_info": {
  322. "avg_age": "--",
  323. "prescription_info": {
  324. "statement": "近期农事复核良好",
  325. "key": "农事"
  326. },
  327. "avg_branch_num": 81,
  328. "avg_crown": 13.4,
  329. "phenology_info": {
  330. "statement": "2025年4月15日,进入小果期",
  331. "key": "物候"
  332. },
  333. "grow_alert_info": {
  334. "statement": "近期无异常",
  335. "key": "异常"
  336. },
  337. "dp_alert_info": {
  338. "statement": "近期无病虫害爆发",
  339. "key": "病虫"
  340. }
  341. },
  342. "ecology_info": {
  343. "ventilation": 91,
  344. "transmittance": 94,
  345. "dp_situation": 0
  346. }
  347. },
  348. {
  349. "production_info": {
  350. "production": 1844,
  351. "cihua_ratio": 75,
  352. "quality": 86.4796108551076
  353. },
  354. "type_id": 12,
  355. "meta_info": {
  356. "avg_age": 10,
  357. "prescription_info": {
  358. "statement": "近期农事复核良好",
  359. "key": "农事"
  360. },
  361. "avg_branch_num": 346,
  362. "avg_crown": 43.4,
  363. "phenology_info": {
  364. "statement": "近期无异常",
  365. "key": "物候"
  366. },
  367. "grow_alert_info": {
  368. "statement": "近期无异常",
  369. "key": "异常"
  370. },
  371. "dp_alert_info": {
  372. "statement": "近期无病虫害爆发",
  373. "key": "病虫"
  374. }
  375. },
  376. "ecology_info": {
  377. "ventilation": 61,
  378. "transmittance": 54,
  379. "dp_situation": 9
  380. }
  381. }
  382. ],
  383. "extData": null,
  384. "success": true
  385. })
  386. }//荔博园
  387. if(p.farmId === 80865){
  388. resolve({
  389. "code": 0,
  390. "msg": "",
  391. "data": [
  392. {
  393. "production_info": {
  394. "production": 1244,
  395. "cihua_ratio": 75,
  396. "quality": 96.47
  397. },
  398. "type_id": 0,
  399. "meta_info": {
  400. "avg_age": "--",
  401. "prescription_info": {
  402. "statement": "近期农事复核良好",
  403. "key": "农事"
  404. },
  405. "avg_branch_num": 81,
  406. "avg_crown": 13.4,
  407. "phenology_info": {
  408. "statement": "2025年4月3日,进入小果期",
  409. "key": "物候"
  410. },
  411. "grow_alert_info": {
  412. "statement": "近期无异常",
  413. "key": "异常"
  414. },
  415. "dp_alert_info": {
  416. "statement": "近期无病虫害爆发",
  417. "key": "病虫"
  418. }
  419. },
  420. "ecology_info": {
  421. "ventilation": 91,
  422. "transmittance": 94,
  423. "dp_situation": 0
  424. }
  425. },
  426. {
  427. "production_info": {
  428. "production": 1844,
  429. "cihua_ratio": 75,
  430. "quality": 86.4796108551076
  431. },
  432. "type_id": 12,
  433. "meta_info": {
  434. "avg_age": 10,
  435. "prescription_info": {
  436. "statement": "近期农事复核良好",
  437. "key": "农事"
  438. },
  439. "avg_branch_num": 346,
  440. "avg_crown": 43.4,
  441. "phenology_info": {
  442. "statement": "近期无异常",
  443. "key": "物候"
  444. },
  445. "grow_alert_info": {
  446. "statement": "近期无异常",
  447. "key": "异常"
  448. },
  449. "dp_alert_info": {
  450. "statement": "近期无病虫害爆发",
  451. "key": "病虫"
  452. }
  453. },
  454. "ecology_info": {
  455. "ventilation": 61,
  456. "transmittance": 54,
  457. "dp_situation": 9
  458. }
  459. }
  460. ],
  461. "extData": null,
  462. "success": true
  463. })
  464. }//柏桥
  465. })
  466. }
  467. },
  468. fetchLegendList: {
  469. url: config.base_url + "lz_sample/legendList",
  470. type: "get",
  471. },
  472. }