app-fc7b00d06f.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. /**
  2. * Make sure the charset of the page using this script is
  3. * set to utf-8 or you will not get the correct results.
  4. */
  5. var utf8 = (function () {
  6. var highSurrogateMin = 0xd800,
  7. highSurrogateMax = 0xdbff,
  8. lowSurrogateMin = 0xdc00,
  9. lowSurrogateMax = 0xdfff,
  10. surrogateBase = 0x10000;
  11. function isHighSurrogate(charCode) {
  12. return highSurrogateMin <= charCode && charCode <= highSurrogateMax;
  13. }
  14. function isLowSurrogate(charCode) {
  15. return lowSurrogateMin <= charCode && charCode <= lowSurrogateMax;
  16. }
  17. function combineSurrogate(high, low) {
  18. return ((high - highSurrogateMin) << 10) + (low - lowSurrogateMin) + surrogateBase;
  19. }
  20. /**
  21. * Convert charCode to JavaScript String
  22. * handling UTF16 surrogate pair
  23. */
  24. function chr(charCode) {
  25. var high, low;
  26. if (charCode < surrogateBase) {
  27. return String.fromCharCode(charCode);
  28. }
  29. // convert to UTF16 surrogate pair
  30. high = ((charCode - surrogateBase) >> 10) + highSurrogateMin,
  31. low = (charCode & 0x3ff) + lowSurrogateMin;
  32. return String.fromCharCode(high, low);
  33. }
  34. /**
  35. * Convert JavaScript String to an Array of
  36. * UTF8 bytes
  37. * @export
  38. */
  39. function stringToBytes(str) {
  40. var bytes = [],
  41. strLength = str.length,
  42. strIndex = 0,
  43. charCode, charCode2;
  44. while (strIndex < strLength) {
  45. charCode = str.charCodeAt(strIndex++);
  46. // handle surrogate pair
  47. if (isHighSurrogate(charCode)) {
  48. if (strIndex === strLength) {
  49. throw new Error('Invalid format');
  50. }
  51. charCode2 = str.charCodeAt(strIndex++);
  52. if (!isLowSurrogate(charCode2)) {
  53. throw new Error('Invalid format');
  54. }
  55. charCode = combineSurrogate(charCode, charCode2);
  56. }
  57. // convert charCode to UTF8 bytes
  58. if (charCode < 0x80) {
  59. // one byte
  60. bytes.push(charCode);
  61. }
  62. else if (charCode < 0x800) {
  63. // two bytes
  64. bytes.push(0xc0 | (charCode >> 6));
  65. bytes.push(0x80 | (charCode & 0x3f));
  66. }
  67. else if (charCode < 0x10000) {
  68. // three bytes
  69. bytes.push(0xe0 | (charCode >> 12));
  70. bytes.push(0x80 | ((charCode >> 6) & 0x3f));
  71. bytes.push(0x80 | (charCode & 0x3f));
  72. }
  73. else {
  74. // four bytes
  75. bytes.push(0xf0 | (charCode >> 18));
  76. bytes.push(0x80 | ((charCode >> 12) & 0x3f));
  77. bytes.push(0x80 | ((charCode >> 6) & 0x3f));
  78. bytes.push(0x80 | (charCode & 0x3f));
  79. }
  80. }
  81. return bytes;
  82. }
  83. /**
  84. * Convert an Array of UTF8 bytes to
  85. * a JavaScript String
  86. * @export
  87. */
  88. function bytesToString(bytes) {
  89. var str = '',
  90. length = bytes.length,
  91. index = 0,
  92. byte,
  93. charCode;
  94. while (index < length) {
  95. // first byte
  96. byte = bytes[index++];
  97. if (byte < 0x80) {
  98. // one byte
  99. charCode = byte;
  100. }
  101. else if ((byte >> 5) === 0x06) {
  102. // two bytes
  103. charCode = ((byte & 0x1f) << 6) | (bytes[index++] & 0x3f);
  104. }
  105. else if ((byte >> 4) === 0x0e) {
  106. // three bytes
  107. charCode = ((byte & 0x0f) << 12) | ((bytes[index++] & 0x3f) << 6) | (bytes[index++] & 0x3f);
  108. }
  109. else {
  110. // four bytes
  111. charCode = ((byte & 0x07) << 18) | ((bytes[index++] & 0x3f) << 12) | ((bytes[index++] & 0x3f) << 6) | (bytes[index++] & 0x3f);
  112. }
  113. str += chr(charCode);
  114. }
  115. return str;
  116. }
  117. return {
  118. stringToBytes: stringToBytes,
  119. bytesToString: bytesToString
  120. };
  121. }());
  122. 'use strict';
  123. var app = angular.module('app', [
  124. 'ui.router',
  125. 'templatescache',
  126. 'ngAnimate',
  127. 'ngCookies'
  128. ]);
  129. angular.module('app').run(['$rootScope', '$state', '$stateParams',
  130. function($rootScope, $state, $stateParams) {
  131. $rootScope.$state = $state;
  132. $rootScope.$stateParams = $stateParams;
  133. }
  134. ]).config(['$stateProvider', '$urlRouterProvider',
  135. function($stateProvider, $urlRouterProvider) {
  136. $urlRouterProvider.otherwise('/home'); //
  137. $stateProvider.state('home', {
  138. url: '/home',
  139. templateUrl: 'templates/home.html',
  140. controller: 'HomeController'
  141. })
  142. .state('webChat', {
  143. url: '/webChat',
  144. templateUrl: 'templates/webChat.html',
  145. controller: 'WebController'
  146. })
  147. .state('webChat.service', {
  148. url: '/service',
  149. templateUrl: 'templates/service.html',
  150. controller: 'WebController'
  151. })
  152. .state('webChat.maxOne', {
  153. url: '/maxOne',
  154. templateUrl: 'templates/maxOne.html',
  155. controller: 'WebController'
  156. })
  157. .state('webChat.guide', {
  158. url: '/guide',
  159. templateUrl: 'templates/guide.html',
  160. controller: 'WebController'
  161. })
  162. .state('webChat.search', {
  163. url: '/search',
  164. templateUrl: 'templates/search.html',
  165. controller: 'WebController'
  166. })
  167. .state('webChat.listView', {
  168. url: '/listView',
  169. templateUrl: 'templates/listView.html',
  170. controller: 'WebController'
  171. })
  172. .state('webChat.detail', {
  173. url: '/detail',
  174. params: { data: {} }, //
  175. templateUrl: 'templates/detail.html',
  176. controller: 'WebController'
  177. });
  178. }
  179. ]);
  180. angular.module('templatescache', []).run(['$templateCache', function($templateCache) {$templateCache.put('templates/detail.html','');
  181. $templateCache.put('templates/guide.html','');
  182. $templateCache.put('templates/home.html','<div class="lszw-home">\r\n <!--<div class="bgImg">\r\n </div>-->\r\n <div class="county">\r\n <p ng-click="menuLeft($event)" class="lf menu-icon"><span class="glyphicon glyphicon-map-marker"></span><span id="city">\u4E3D\u6C34\u5E02</span></p>\r\n </div>\r\n <div class="guides">\r\n <div class="lab maxOne" ui-sref="">\r\n <p><span class="glyphicon glyphicon-send"></span><span>\u6700\u591A\u8DD1\u4E00\u6B21</span></p>\r\n </div>\r\n <div class="lab service" ui-sref="">\r\n <p><span class="glyphicon glyphicon-th-list"></span><span>\u670D\u52A1\u4E8B\u9879</span></p>\r\n </div>\r\n <div class="lab guide" ui-sref="">\r\n <p><span class="glyphicon glyphicon-list-alt"></span><span>\u7A97\u53E3\u5F15\u5BFC</span></p>\r\n </div>\r\n <div class="lab seacch " ui-sref="">\r\n <p><span class="glyphicon glyphicon-phone-alt"></span><span>12345</span></p>\r\n </div>\r\n </div>\r\n <div class="hot-point">\r\n <div class="input-search">\r\n <input type="text" class="form-control input-sm" placeholder="\u641C\u7D22\u4E8B\u9879 . . ." ng-change="searchUser()" ng-model="searchName">\r\n <span class="glyphicon glyphicon-search"></span>\r\n <span id="search">\u641C\u7D22</span>\r\n </div>\r\n <div class="hot">\r\n <p class="hot-title"><span>\u70ED\u70B9\u4E8B\u9879</span><span class="addHot">+ \u6DFB\u52A0</span></p>\r\n <div class="line">\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-tint" style="background-color: #71D5A6;"></span><span>\u793E\u4FDD</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-grain" style="background-color: #FFC547;"></span><span>\u516C\u79EF\u91D1</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-book" style="background-color: #FA7471;"></span><span>\u6237\u53E3</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-user" style="background-color: #40A1E6;"></span><span>\u8EAB\u4EFD\u8BC1</span>\r\n </div>\r\n </div>\r\n <div class="line">\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-envelope" style="background-color: #FA7471;"></span><span>\u6863\u6848</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-film" style="background-color: #40A1E6;"></span><span>\u9A7E\u9A76\u8BC1</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-yen" style="background-color: #FFC547;"></span><span>\u5DE5\u5546</span>\r\n </div>\r\n <div class="ico">\r\n <span class="glyphicon glyphicon-home" style="background-color: #71D5A6;"></span><span>\u4F01\u4E1A\u8BBE\u7ACB</span>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="menu" ng-click="menuLeft($event)">\r\n <div class="app-menu">\r\n <ul class="sidenav">\r\n <div class="title"> \u7AD9\u70B9\u5217\u8868</div>\r\n <li ng-value="0"><a ng-value="0" class="city actived" href="#">\u4E3D\u6C34\u5E02\u672C\u7EA7 <span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="1"><a ng-value="1" class="city" href="#">\u83B2\u90FD\u533A <span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="2"><a ng-value="2" class="city" href="#">\u9F99\u6CC9\u5E02<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="3"><a ng-value="3" class="city" href="#">\u9752\u7530\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="4"><a ng-value="4" class="city" href="#">\u4E91\u548C\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="5"><a ng-value="5" class="city" href="#">\u5E86\u5143\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="6"><a ng-value="6" class="city" href="#">\u7F19\u4E91\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="7"><a ng-value="7" class="city" href="#">\u9042\u660C\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="8"><a ng-value="8" class="city" href="#">\u677E\u9633\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="9"><a ng-value="9" class="city" href="#">\u666F\u5B81\u53BF<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n <li ng-value="10"><a ng-value="10" class="city" href="#">\u7ECF\u6D4E\u5F00\u53D1\u533A<span class="glyphicon glyphicon-menu-right right"></span></a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</div>');
  183. $templateCache.put('templates/listView.html','');
  184. $templateCache.put('templates/maxOne.html','');
  185. $templateCache.put('templates/search.html','');
  186. $templateCache.put('templates/service.html','');
  187. $templateCache.put('templates/webChat.html','<header>\n</header>\n<content ui-view></content>\n\n<footer class="foot">\n</footer>');}]);
  188. 'use strict';
  189. angular.module('app').controller('HomeController', ['$scope', 'messageService', function($scope, messageService) {
  190. $scope.$on('$viewContentLoaded', function() {
  191. });
  192. $scope.menuLeft = function(event) {
  193. var actived = $(event.target);
  194. var myMenu = $(".menu")[0];
  195. console.log(actived);
  196. if (myMenu.className.indexOf("menu--visible") == -1) {
  197. angular.element(".menu").addClass("menu--visible");
  198. } else if (actived[0].className.indexOf("menu--visible") !== -1) {
  199. angular.element(".menu").removeClass("menu--visible");
  200. } else if (actived[0].className.indexOf("menu--visible") == -1 && actived[0].innerText.indexOf("站点列表") == -1) {
  201. if (actived[0].innerText == "丽水市本级") {
  202. $("#city")[0].textContent = "丽水市";
  203. angular.element(".menu").removeClass("menu--visible");
  204. angular.element(".actived").removeClass("actived");
  205. actived.addClass("actived");
  206. $(actived[0].children).addClass("actived");
  207. messageService.setCounty(actived[0].value);
  208. messageService.getCounty(function(response) {
  209. console.log("Success", response);
  210. },
  211. function(error) { console.log("error!"); });
  212. } else if (actived[0].innerText !== "") {
  213. $("#city")[0].textContent = actived[0].innerText;
  214. angular.element(".menu").removeClass("menu--visible");
  215. angular.element(".actived").removeClass("actived");
  216. actived.addClass("actived");
  217. $(actived[0].children).addClass("actived");
  218. }
  219. }
  220. };
  221. }]);
  222. 'use strict';
  223. angular.module('app').controller('WebController', ['$scope', function($scope) {
  224. //lxtalkClient.Invoke('{FB60F992-A0FD-47B3-AAA7-E80DF209C5A4}', '_Register', '', $scope);
  225. }]);
  226. 'use strict';
  227. angular.module('app').service('messageService', ['$http', function($http) {
  228. var self = this;
  229. this.countyId = 0;
  230. this.setCounty = function(countyId) {
  231. this.countyId = countyId;
  232. };
  233. this.getCounty = function(successCallback, failsCallback) {
  234. $http.get('http://192.168.0.75/api/branch/all/' + this.countyId).then(successCallback, failsCallback);
  235. };
  236. this.getByBranch = function(guId, successCallback, failsCallback) {
  237. $http.get('http://192.168.0.75/api/powermatter/getByBranch/' + this.countyId + '/' + guId).then(successCallback, failsCallback);
  238. };
  239. this.getDetail = function(qlCode, successCallback, failsCallback) {
  240. $http.get('http://192.168.0.75/api/powermatter/detail/' + this.countyId + '/' + qlCode).then(successCallback, failsCallback);
  241. };
  242. }]);