dataprocessing.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. import store from '../common/store.js'
  2. class Dataprocessing {
  3. constructor() {
  4. }
  5. //
  6. putWindPowerStationName(windPowerStationName) {
  7. uni.setStorageSync('windpowerstationName', windPowerStationName);
  8. }
  9. putWindPowerStationId(windPowerStationId) {
  10. uni.setStorageSync('windPowerStationId', windPowerStationId);
  11. }
  12. getWindPowerStationName() {
  13. return uni.getStorageSync('windpowerstationName');
  14. }
  15. getWindPowerStationId() {
  16. return uni.getStorageSync('windPowerStationId');
  17. }
  18. getWindPowerStationNameById(name) {
  19. if (name == '宁夏新能源公司') {
  20. let wpId = '0';
  21. return wpId;
  22. } else if (name == '麻黄山风电场') {
  23. let wpId = 'MHS_FDC';
  24. return wpId;
  25. } else if (name == '牛首山风电场') {
  26. let wpId = 'NSS_FDC';
  27. return wpId;
  28. } else if (name == '石板泉风电场') {
  29. let wpId = 'SBQ_FDC';
  30. return wpId;
  31. } else if (name == '青山风电场') {
  32. let wpId = 'QS_FDC';
  33. return wpId;
  34. } else if (name == '香山风电场') {
  35. let wpId = 'XS_FDC';
  36. return wpId;
  37. } else if (name == '河北能源集团') {
  38. let wpId = '0';
  39. return wpId;
  40. } else if (name == '崇礼风电场') {
  41. let wpId = 'CL_FDC';
  42. return wpId;
  43. } else if (name == '康保风电场') {
  44. let wpId = 'KB_FDC';
  45. return wpId;
  46. } else if (name == '代县风电场') {
  47. let wpId = 'DX_FDC';
  48. return wpId;
  49. }
  50. }
  51. getWindPowerStationNameByWeatherId(name) {
  52. if (name == '宁夏新能源公司') {
  53. let wpId = 'MHS_FDC';
  54. return wpId;
  55. } else if (name == '麻黄山风电场') {
  56. let wpId = 'MHS_FDC';
  57. return wpId;
  58. } else if (name == '牛首山风电场') {
  59. let wpId = 'NSS_FDC';
  60. return wpId;
  61. } else if (name == '石板泉风电场') {
  62. let wpId = 'SBQ_FDC';
  63. return wpId;
  64. } else if (name == '青山风电场') {
  65. let wpId = 'QS_FDC';
  66. return wpId;
  67. } else if (name == '香山风电场') {
  68. let wpId = 'XS_FDC';
  69. return wpId;
  70. } else if (name == '河北能源集团') {
  71. let wpId = 'CL_FDC';
  72. return wpId;
  73. } else if (name == '崇礼风电场') {
  74. let wpId = 'CL_FDC';
  75. return wpId;
  76. } else if (name == '康保风电场') {
  77. let wpId = 'KB_FDC';
  78. return wpId;
  79. } else if (name == '代县风电场') {
  80. let wpId = 'DX_FDC';
  81. return wpId;
  82. }
  83. }
  84. getWindPowerStationNameByNames(name) {
  85. if (name == '宁夏新能源公司') {
  86. let windStations = ['麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
  87. return windStations;
  88. } else if (name == '麻黄山风电场') {
  89. let windStations = ['麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
  90. return windStations;
  91. } else if (name == '牛首山风电场') {
  92. let windStations = ['牛首山风电场', '麻黄山风电场', '石板泉风电场', '青山风电场', '香山风电场'];
  93. return windStations;
  94. } else if (name == '石板泉风电场') {
  95. let windStations = ['石板泉风电场', '麻黄山风电场', '牛首山风电场', '青山风电场', '香山风电场'];
  96. return windStations;
  97. } else if (name == '香山风电场') {
  98. let windStations = ['香山风电场', '麻黄山风电场', '牛首山风电场', '石板泉风电场', '青山风电场'];
  99. return windStations;
  100. } else if (name == '青山风电场') {
  101. let windStations = ['青山风电场', '麻黄山风电场', '牛首山风电场', '石板泉风电场', '香山风电场'];
  102. return windStations;
  103. } else if (name == '河北能源集团') {
  104. let windStations = ['崇礼风电场', '康保风电场', '代县风电场'];
  105. return windStations;
  106. } else if (name == '崇礼风电场') {
  107. let windStations = ['崇礼风电场', '康保风电场', '代县风电场'];
  108. return windStations;
  109. } else if (name == '康保风电场') {
  110. let windStations = ['康保风电场', '崇礼风电场', '代县风电场'];
  111. return windStations;
  112. } else if (name == '代县风电场') {
  113. let windStations = ['代县风电场', '康保风电场', '崇礼风电场'];
  114. return windStations;
  115. }
  116. }
  117. viewUserid() {
  118. let userid = uni.getStorageSync('userid');
  119. let ip = store.state.wholeSituationBackStageIp;
  120. let port = store.state.wholeSituationBackStagePort;
  121. uni.request({
  122. url: 'http://' + ip + ':' + port + '/GyeeorganController/GyeeOrganList?userid=' + userid,
  123. data: {},
  124. method: 'GET',
  125. success: function(res) {
  126. let plusDrawerList = [];
  127. let plusDrawerList_weather = [];
  128. for (let j = 0; j < res.data.data.length; j++) {
  129. var obj = {};
  130. obj.name = res.data.data[j].describes;
  131. obj.windId = res.data.data[j].name;
  132. plusDrawerList.push(obj);
  133. }
  134. uni.setStorageSync('windpowerstationName', plusDrawerList[0].name);
  135. uni.setStorageSync('windPowerStationId', plusDrawerList[0].windId);
  136. for (let j = 0; j < res.data.data.length; j++) {
  137. var obj = {};
  138. obj.name = res.data.data[j].describes;
  139. if (res.data.data[j].describes == '宁夏新能源公司') {
  140. obj.windId = 'MHS_FDC';
  141. } else if (res.data.data[j].describes == '河北能源集团') {
  142. obj.windId = 'CL_FDC';
  143. } else {
  144. obj.windId = res.data.data[j].name;
  145. }
  146. plusDrawerList_weather.push(obj);
  147. }
  148. uni.setStorageSync('plusList', plusDrawerList);
  149. uni.setStorageSync('plusList_we', plusDrawerList_weather);
  150. }
  151. })
  152. }
  153. monitoringAuthority() {
  154. let userid = uni.getStorageSync('userid');
  155. let ip = store.state.wholeSituationBackStageIp;
  156. let port = store.state.wholeSituationBackStagePort;
  157. uni.request({
  158. url: 'http://' + ip + ':' + port + '/GyeepermissionController/GyeePermissionList?userid=' + userid,
  159. data: {},
  160. method: 'GET',
  161. success: function(res) {
  162. let leftlist1 = [];
  163. let leftlist2 = [];
  164. let leftlist3 = [];
  165. let leftlist4 = [];
  166. let leftlist5 = [];
  167. for (let j = 0; j < res.data.data.length; j++) {
  168. let gyeePermissionList = res.data.data[j].gyeePermissionList;
  169. if (j == 0) {
  170. for (let k = 0; k < gyeePermissionList.length; k++) {
  171. var obj = {};
  172. obj.name = gyeePermissionList[k].permisssionname;
  173. obj.remark1 = gyeePermissionList[k].remark1;
  174. leftlist1.push(obj);
  175. }
  176. } else if (j == 1) {
  177. for (let k = 0; k < gyeePermissionList.length; k++) {
  178. var obj = {};
  179. obj.name = gyeePermissionList[k].permisssionname;
  180. obj.remark1 = gyeePermissionList[k].remark1;
  181. leftlist2.push(obj);
  182. }
  183. } else if (j == 2) {
  184. for (let k = 0; k < gyeePermissionList.length; k++) {
  185. var obj = {};
  186. obj.name = gyeePermissionList[k].permisssionname;
  187. obj.remark1 = gyeePermissionList[k].remark1;
  188. leftlist3.push(obj);
  189. }
  190. } else if (j == 3) {
  191. for (let k = 0; k < gyeePermissionList.length; k++) {
  192. var obj = {};
  193. obj.name = gyeePermissionList[k].permisssionname;
  194. obj.remark1 = gyeePermissionList[k].remark1;
  195. leftlist4.push(obj);
  196. }
  197. } else if (j == 4) {
  198. for (let k = 0; k < gyeePermissionList.length; k++) {
  199. var obj = {};
  200. obj.id = gyeePermissionList[k].id;
  201. obj.name = gyeePermissionList[k].permisssionname;
  202. obj.remark1 = gyeePermissionList[k].remark1;
  203. leftlist5.push(obj);
  204. }
  205. }
  206. }
  207. uni.setStorageSync('leftlist1', leftlist1);
  208. uni.setStorageSync('leftlist2', leftlist2);
  209. uni.setStorageSync('leftlist3', leftlist3);
  210. uni.setStorageSync('leftlist4', leftlist4);
  211. uni.setStorageSync('leftlist5', leftlist5);
  212. }
  213. })
  214. }
  215. }
  216. let dataprocessing = new Dataprocessing();
  217. export default dataprocessing;