main.js 86 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211
  1. console.info('v1.0.3');
  2. var app = angular.module('itsmApp', ['itsm-dep']);
  3. var domainName = document.domain;//域名
  4. var protocolName = document.location.protocol;//http协议
  5. // var appchild = angular.module('itsmApp', ['itsm-dep']);
  6. //本地测试
  7. // var serverIp = "http://localhost/service";
  8. // var reportIp = "http://localhost/service";
  9. // var inspectIp = "http://localhost/service";
  10. // var imgBaseUrl = "http://localhost";
  11. // var callIp = "http://192.168.3.122:29005";
  12. //线上
  13. var serverIp = protocolName + "//" + domainName + "/service";
  14. var reportIp = protocolName + "//" + domainName + "/service";
  15. // var inspectIp = protocolName + "//" + domainName + "/service";
  16. var inspectIp = "http://192.168.77.57";
  17. var imgBaseUrl = protocolName + "//" + domainName;
  18. var callIp = protocolName + "//" + domainName;
  19. // var seiminCallIp = '192.168.3.233';//本地
  20. // var seiminCallIp = '202.114.235.100';//财大
  21. var seiminCallIp = '';
  22. if(document.domain === 'itsm.zuel.edu.cn'){
  23. seiminCallIp = '202.114.235.100:5678';//财大
  24. }else{
  25. // seiminCallIp = '192.168.3.130:5678';//本地
  26. seiminCallIp = '10.167.44.50:5678';//华农
  27. }
  28. // 信用社
  29. // var serverIp = "http://192.168.2.63:80/service"; //跟其他有关
  30. // var reportIp = "http://192.168.2.63:80/service"; //跟报表有关
  31. // var inspectIp = "http://192.168.2.63:80/service";
  32. // var callIp = "http://192.168.2.63:80/service";
  33. //101测试
  34. // var serverIp = "http://192.168.3.101/service";
  35. // var reportIp = "http://192.168.3.101/service";
  36. // var inspectIp = "http://192.168.3.101/service";
  37. // var imgBaseUrl = "http://192.168.3.101";//富文本框上传图片路径
  38. // var callIp = "http://192.168.3.122:29005";
  39. // 139
  40. // var serverIp = "http://itsmpoc.dashitech.com/service";
  41. // var reportIp = "http://itsmpoc.dashitech.com/service"; //跟报表有关
  42. // var inspectIp = "http://itsmpoc.dashitech.com/service";
  43. // var callIp = "http://192.168.3.122:29005";
  44. app.run(['$rootScope', '$state', '$stateParams', '$auth', '$http', '$cookieStore', 'Restangular', 'api_login',
  45. function ($rootScope, $state, $stateParams, $auth, $http, $cookieStore, Restangular, api_login) {
  46. $rootScope.seiminCallIp = seiminCallIp;
  47. // Attach Fastclick for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers
  48. FastClick.attach(document.body);
  49. // Set some reference to access them from any scope
  50. $rootScope.$state = $state;
  51. $rootScope.$stateParams = $stateParams;
  52. // GLOBAL APP SCOPE
  53. // set below basic information
  54. // $rootScope.audioiIp="http://218.197.181.213:8080"
  55. $rootScope.app = {
  56. name: '', // name of your project
  57. author: '', // author's name or company name
  58. description: '', // brief description
  59. version: 'V2.0', // current version
  60. year: ((new Date()).getFullYear()), // automatic current year (for copyright information)
  61. isMobile: (function () { // true if the browser is a mobile device
  62. var check = false;
  63. if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
  64. check = true;
  65. };
  66. return check;
  67. })(),
  68. isChrome: false,
  69. isLoginFixed: false,
  70. layout: {
  71. // isLoginFixed: true,
  72. isNavbarFixed: true, //true if you want to initialize the template with fixed header
  73. isSidebarFixed: true, // true if you want to initialize the template with fixed sidebar
  74. isSidebarClosed: false, // true if you want to initialize the template with closed sidebar
  75. isFooterFixed: false, // true if you want to initialize the template with fixed footer
  76. theme: 'theme-8', // indicate the theme chosen for your project
  77. logo: 'assets/images/logo.png' // relative path of the project logo
  78. }
  79. };
  80. // 获取项目名称----网络与信息化运维管理系统
  81. $rootScope.getProjectName = function () {
  82. api_login.getProjectName().then(function (res) {
  83. $rootScope.app.name = $rootScope.app.author = $rootScope.app.description = res.sysName;
  84. })
  85. }
  86. $rootScope.getProjectName();
  87. // $http.defaults.headers.common["X-Auth-Token"] = $cookieStore.get('Auth-Token') || null;
  88. // $http.defaults.headers.common["X-Auth-Token"] = $cookieStore.get('Auth-Token') || null;
  89. Restangular.setErrorInterceptor(function (element, operation, what, url, headers, queryParams) {
  90. if (!url) {
  91. // console.log($http);
  92. // console.log($auth);
  93. if (element.config.url ==
  94. "http://testncc.hust.edu.cn/service/bpm/data/getCount"
  95. ) {
  96. window.location.href = serviceip;
  97. document.getElementById("casUserId").value = null;
  98. }
  99. }
  100. // console.log(element);
  101. })
  102. Restangular.setFullRequestInterceptor(function (element, operation, what, url, headers, queryParams) {
  103. var token = $cookieStore.get('Auth-Token') || null;
  104. var isReportUri = url.indexOf('saiku') > 0;
  105. if (token && isReportUri) {
  106. return {
  107. element: element,
  108. params: queryParams,
  109. headers: _.extend({}, headers, {
  110. 'X-Auth-Token': $cookieStore.get('Auth-Token') || null
  111. })
  112. };
  113. } else {
  114. return {
  115. element: element,
  116. params: queryParams,
  117. headers: headers
  118. };
  119. }
  120. });
  121. Restangular.addResponseInterceptor(function (data, operation, what, url, response, deferred) {
  122. var ua = window.navigator.userAgent.toLowerCase();
  123. ua.match(/chrome/i)
  124. if (data) {
  125. if (data.state == "433") {
  126. $rootScope.logout();
  127. var Notification = window.Notification;
  128. Notification.requestPermission();
  129. sessionStorage.clear();
  130. data = {};
  131. var n = new Notification("登录退出", {
  132. body: "您的账号在其他地方登录,请确认后重新登录",
  133. icon: './bower_components/HTML5-Desktop-Notifications/alert.ico',
  134. onclick: function onNotificationClicked() {
  135. console.log('Notification clicked.');
  136. }
  137. });
  138. } else if (data.state == "403") {
  139. $state.go("app.dashboard");
  140. var Notification = window.Notification;
  141. Notification.requestPermission();
  142. var n = new Notification("无权限访问", {
  143. body: "此页面无权限访问",
  144. icon: './bower_components/HTML5-Desktop-Notifications/alert.ico',
  145. onclick: function onNotificationClicked() {
  146. console.log('Notification clicked.');
  147. }
  148. });
  149. } else {
  150. deferred.resolve(data)
  151. }
  152. }
  153. });
  154. // $rootScope.nickname ='lijin';
  155. // $rootScope.user = {
  156. // name: 'Peter',
  157. // job: 'ng-Dev',
  158. // picture: 'app/img/user/02.jpg'
  159. // };
  160. }
  161. ]);
  162. // translate config
  163. app.config(['$translateProvider',
  164. function ($translateProvider) {
  165. // prefix and suffix information is required to specify a pattern
  166. // You can simply use the static-files loader with this pattern:
  167. $translateProvider.useStaticFilesLoader({
  168. prefix: 'assets/i18n/',
  169. suffix: '.json'
  170. });
  171. // Since you've now registered more then one translation table, angular-translate has to know which one to use.
  172. // This is where preferredLanguage(langKey) comes in.
  173. $translateProvider.preferredLanguage('zh');
  174. // Store the language in the local storage
  175. $translateProvider.useLocalStorage();
  176. }
  177. ]);
  178. // Angular-Loading-Bar
  179. // configuration
  180. app.config(['cfpLoadingBarProvider',
  181. function (cfpLoadingBarProvider) {
  182. cfpLoadingBarProvider.includeBar = true;
  183. cfpLoadingBarProvider.includeSpinner = false;
  184. }
  185. ]);
  186. /**
  187. * // http: //115.156.150.70:9680/webservice/data/fetchDataList/queryUser
  188. */
  189. //信息中心 --wt
  190. app.factory('msgRestangular', function (Restangular) {
  191. return Restangular.withConfig(function (RestangularConfigurer) {
  192. RestangularConfigurer.setBaseUrl(serverIp + '/messageStation');
  193. });
  194. });
  195. app.factory('api_msg', ['msgRestangular', function (msgRestangular) {
  196. var msgService = msgRestangular.all("data");
  197. return {
  198. msgDataList: function (data) {
  199. return msgService.customPOST(data, 'fetchDataList/messageStation', {});
  200. },
  201. updateDataList: function (data) {
  202. return msgService.customPOST(data, 'updateModel/messageStation', {});
  203. },
  204. };
  205. }]);
  206. /**
  207. * // http: //115.156.150.70:9680/api/webservice/data/fetchDataList/queryUser
  208. */
  209. app.config(['RestangularProvider', function (RestangularProvider) {
  210. RestangularProvider.setBaseUrl('');
  211. }]);
  212. app.factory('serviceip', function (Restangular) {
  213. return Restangular.withConfig(function (RestangularConfigurer) {
  214. RestangularConfigurer.setBaseUrl(serviceip);
  215. });
  216. });
  217. app.factory('WechatRestangular', function (Restangular) {
  218. return Restangular.withConfig(function (RestangularConfigurer) {
  219. RestangularConfigurer.setBaseUrl(serverIp + '/common/');
  220. });
  221. });
  222. // 事件分类
  223. app.factory('eventCategory', function (Restangular) {
  224. return Restangular.withConfig(function (RestangularConfigurer) {
  225. RestangularConfigurer.setBaseUrl(serverIp + '/bpm/data/');
  226. });
  227. });
  228. app.factory('jry_api_bpm', ['eventCategory', function (eventCategory) {
  229. var jry_incidentService = eventCategory.all("fetchDataList");
  230. var jry_add = eventCategory.all("addData");
  231. var jry_updata = eventCategory.all("updData");
  232. var jry_movdata = eventCategory.all("rmvData");
  233. var jry_fetchDeptByPhone = eventCategory.all("fetchDeptByPhone");//呼叫中心电话查详情
  234. return {
  235. //呼叫中心电话查详情
  236. jry_fetchDeptByPhone: function (key, data) {
  237. return jry_fetchDeptByPhone.customPOST(data, key, {});
  238. },
  239. jry_getFaultScri: function (key, data) {
  240. return jry_incidentService.customPOST(data, key, {});
  241. },
  242. jry_getIncidentScri: function (data) {
  243. return jry_incidentService.customPOST(data, 'incidentdescribe', {});
  244. },
  245. jry_getFetchDataList: function (data, key) {
  246. return jry_incidentService.customPOST(data, key, {});
  247. },
  248. jry_addFn: function (data, key) {
  249. return jry_add.customPOST(data, key, {});
  250. },
  251. jry_editFn: function (data, key) {
  252. return jry_updata.customPOST(data, key, {});
  253. },
  254. jry_movFn: function (data, key) {
  255. return jry_movdata.customPOST(data, key, {});
  256. }
  257. };
  258. }]);
  259. app.factory('api_wechatfile', ['WechatRestangular', function (WechatRestangular) {
  260. var dataService = WechatRestangular.all("common");
  261. return {
  262. jry_download: function (attachmentId) {
  263. return dataService.one('downloadAttachment/' + attachmentId);
  264. },
  265. listAttachments: function (type, model) {
  266. return dataService.customGET('listAttachment/' + type + "/" + model, {});
  267. // return dataService.one('listAttachment/' + type + "/" + model);
  268. },
  269. listAttachment: function (type, model) {
  270. return dataService.customGET('listAttachment/' + type + "/" + model, {});
  271. // return dataService.one('listAttachment/' + type + "/" + model);
  272. },
  273. downloadAttachment: function (model) {
  274. return dataService.one('downloadAttachment/' + model, {});
  275. },
  276. attachmentsPreviewUrl: function (attachmentId) {
  277. return dataService.customGET('attachmentsPreviewUrl/' + attachmentId);
  278. },
  279. download: function (attachmentId) {
  280. return dataService.one('getAttachmentContent/' + attachmentId);
  281. },
  282. getDictionary: function (data) {
  283. return dataService.customPOST(data, 'getDictionary', {});
  284. },
  285. getDictionaryForList: function (data) {
  286. return dataService.customPOST(data, 'getDictionaryForList', {});
  287. },
  288. addDictionary: function (data) {
  289. return dataService.customPOST(data, 'addDictionary', {});
  290. }
  291. };
  292. }]);
  293. //报表
  294. app.factory('hkreportRestangular', function(Restangular) {
  295. return Restangular.withConfig(function(RestangularConfigurer) {
  296. RestangularConfigurer.setBaseUrl(reportIp + '/statistics');
  297. });
  298. });
  299. app.factory('api_hkreport', ['hkreportRestangular', function(hkreportRestangular) {
  300. var msgService = hkreportRestangular.all("data");
  301. return {
  302. incidentreport: function(data, key) {
  303. return msgService.customPOST(data, key, {});
  304. }
  305. };
  306. }]);
  307. app.factory('webserviceRestangular', function (Restangular) {
  308. return Restangular.withConfig(function (RestangularConfigurer) {
  309. RestangularConfigurer.setBaseUrl(serverIp + '/webservice/');
  310. });
  311. });
  312. app.factory('api_webservice', ['webserviceRestangular', function (webserviceRestangular) {
  313. var dataService = webserviceRestangular.all("data");
  314. return {
  315. fetchDataList: function (model, data) {
  316. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  317. }
  318. };
  319. }]);
  320. app.factory('api_webservice1', ['webserviceRestangular', function (webserviceRestangular) {
  321. var dataService = webserviceRestangular.all("");
  322. return {
  323. fetchDataList: function (model, data) {
  324. return dataService.customPOST(data, 'samsQuery/' + model, {});
  325. },
  326. notifyUser: function (data) {
  327. return dataService.customPOST(data, 'notifyUser', {});
  328. }
  329. };
  330. }]);
  331. app.factory('playRestangular', function (Restangular) {
  332. return Restangular.withConfig(function (RestangularConfigurer) {
  333. RestangularConfigurer.setBaseUrl(callIp);
  334. });
  335. });
  336. app.factory('api_playservice', ['playRestangular', function (playRestangular) {
  337. var dataService = playRestangular.all("recording");
  338. return {
  339. playData: function (attachmentId) {
  340. return dataService.customGET('recording?callID=' + attachmentId);
  341. },
  342. };
  343. }]);
  344. app.factory('ConversationRestangular', function (Restangular) {
  345. return Restangular.withConfig(function (RestangularConfigurer) {
  346. RestangularConfigurer.setBaseUrl(serverIp + '/conversation/');
  347. });
  348. });
  349. app.factory('api_conversation', ['ConversationRestangular', function (ConversationRestangular) {
  350. var dataService = ConversationRestangular.all("conversation");
  351. return {
  352. roleMenu: function (model) {
  353. return dataService.customGET('roleMenu/' + model, {});
  354. },
  355. pageMenuByCode: function (model) {
  356. return dataService.customGET('pageMenuByCode/' + model, {});
  357. },
  358. pageEvent: function (data, model) {
  359. return dataService.customPOST(data, 'pageEvent', {});
  360. }
  361. };
  362. }]);
  363. app.factory('textRestangular', function (Restangular) {
  364. return Restangular.withConfig(function (RestangularConfigurer) {
  365. // RestangularConfigurer.setBaseUrl(inspectIp + ':8080/IXServer/');
  366. RestangularConfigurer.setBaseUrl(inspectIp + ':8088/IXServer/');
  367. });
  368. });
  369. app.factory('api_text', ['textRestangular', function (textRestangular) {
  370. var loginService = textRestangular.all("comm");
  371. var loginsins = textRestangular.all("tele/agent");
  372. return {
  373. start: function (phone, id) {
  374. var rdata = "dom=0&epwd=&aid=" + id + "&apwd=e10adc3949ba59abbe56e057f20f883e&adn=" + phone;
  375. return loginService.customPOST(rdata, 'start', {}, {
  376. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  377. });
  378. },
  379. exit: function (token) {
  380. var rdata = "dom=0&token=" + token;
  381. return loginService.customPOST(rdata, 'exit', {}, {
  382. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  383. });
  384. },
  385. login: function (group, token, id) {
  386. var rdata = "dom=0&token=" + token + "&aid=" + id + "&acd=" + group + "&skill=-1&mon=false&silent=false";
  387. return loginsins.customPOST(rdata, 'login', {}, {
  388. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  389. });
  390. },
  391. logout: function (token, id) {
  392. var rdata = "dom=0&token=" + token + "&aid=" + id + "";
  393. return loginsins.customPOST(rdata, 'logout', {}, {
  394. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  395. });
  396. },
  397. dialout: function (token, gid, teleno) {
  398. var rdata = "dom=0&token=" + token + "&teleno=" + teleno + "&gid=" + gid + "&uud=&async=true";
  399. return loginsins.customPOST(rdata, 'dialout', {}, {
  400. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  401. });
  402. },
  403. callout: function (token, teleno) {
  404. var rdata = "dom=0&token=" + token + "&teleno=" + teleno + "&uud=&async=true";
  405. return loginsins.customPOST(rdata, 'dialout', {}, {
  406. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  407. });
  408. },
  409. setbusy: function (token) {
  410. var rdata = "dom=0&token=" + token;
  411. return loginsins.customPOST(rdata, 'setbusy', {}, {
  412. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  413. });
  414. },
  415. setidle: function (token) {
  416. var rdata = "dom=0&token=" + token;
  417. return loginsins.customPOST(rdata, 'setidle', {}, {
  418. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  419. });
  420. },
  421. inittrans: function (telephone, token) {
  422. var rdata = "dom=0&token=" + token + "&teleno=" + telephone + "&uud=&async=true";
  423. return loginsins.customPOST(rdata, 'inittrans', {}, {
  424. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  425. });
  426. },
  427. comptrans: function (telephone, token) {
  428. var rdata = "dom=0&token=" + token;
  429. return loginsins.customPOST(rdata, 'comptrans', {}, {
  430. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  431. });
  432. },
  433. record: function (token) {
  434. var rdata = "dom=0&token=" + token + "&filename=/tmp/agent.wav&async=true&maxtime=10&termchar=&append=true";
  435. return loginsins.customPOST(rdata, 'record', {}, {
  436. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  437. });
  438. },
  439. offhook: function (token) {
  440. var rdata = "dom=0&token=" + token;
  441. return loginsins.customPOST(rdata, 'offhook', {}, {
  442. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  443. });
  444. },
  445. onhook: function (token) {
  446. var rdata = "dom=0&token=" + token;
  447. return loginsins.customPOST(rdata, 'onhook', {}, {
  448. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  449. });
  450. },
  451. getcdrid: function (token) {
  452. var rdata = "dom=0&token=" + token;
  453. return loginsins.customPOST(rdata, 'getcdrid', {}, {
  454. 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  455. });
  456. }
  457. }
  458. }])
  459. app.factory('AuthRestangular', function (Restangular) {
  460. return Restangular.withConfig(function (RestangularConfigurer) {
  461. RestangularConfigurer.setBaseUrl(serverIp);
  462. });
  463. });
  464. app.factory('api_auth', ['AuthRestangular', function (UserRestangular) {
  465. var auths = UserRestangular.all("auth");
  466. return {
  467. resetDuty: function (data) {
  468. return auths.customPOST(data, 'resetDuty', {});
  469. }
  470. };
  471. }]);
  472. app.factory('UserRestangular', function (Restangular) {
  473. return Restangular.withConfig(function (RestangularConfigurer) {
  474. RestangularConfigurer.setBaseUrl(serverIp);
  475. });
  476. });
  477. app.factory('api_user', ['UserRestangular', function (UserRestangular) {
  478. var basePath = "user/";
  479. return {
  480. };
  481. }]);
  482. app.factory('api_report_data', ['UserRestangular', function (UserRestangular) {
  483. var basePath = UserRestangular.all("report/report/");
  484. var datas = UserRestangular.all("data");
  485. var form = UserRestangular.all("form");
  486. var formData = UserRestangular.all("formData");
  487. var reports = UserRestangular.all("statistics/data");
  488. return {
  489. fetchDataList: function (model, data) {
  490. return basePath.customPOST(data, 'fetchDataList/' + model, {});
  491. },
  492. fetchDataList1: function (model, data) {
  493. return datas.customPOST(data, 'fetchDataList/' + model, {});
  494. },
  495. report: function (model, data) {
  496. return basePath.customPOST(data, model, {});
  497. },
  498. addModel: function (model, data) {
  499. return basePath.customPOST(data, 'addModel/' + model, {});
  500. },
  501. updateModel: function (model, data) {
  502. return basePath.customPOST(data, 'updateModel/' + model, {});
  503. },
  504. rmModels: function (model, id) {
  505. return basePath.customPOST(null, 'rmModels/' + id + '/' + model, {});
  506. },
  507. updData: function (model, data) {
  508. return datas.customPOST(data, 'updData/' + model, {});
  509. },
  510. addData: function (model, data) {
  511. return datas.customPOST(data, 'addData/' + model, {});
  512. },
  513. rmvData: function (model, data) {
  514. return datas.customPOST(data, 'rmvData/' + model, {});
  515. },
  516. renderTabForm: function (model) {
  517. return form.customGET('renderTabForm/' + model);
  518. },
  519. updateForm: function (model, data) {
  520. return form.customPOST(data, 'updateForm/' + model, {});
  521. },
  522. formData: function (model, data) {
  523. return formData.customPOST(data, 'rmvData/' + model, {});
  524. },
  525. reportsData: function (model, data) {
  526. return reports.customPOST(data, model, {});
  527. }
  528. };
  529. }]);
  530. app.factory('api_login', ['UserRestangular', function (UserRestangular) {
  531. var loginService = UserRestangular.all("auth");
  532. return {
  533. getProjectName: function () {
  534. return loginService.customGET('getSysName');
  535. },
  536. login: function (username, password) {
  537. return loginService.customPOST(username, 'loginEncrypt', {});
  538. },
  539. sslLogin: function (data = {}) {
  540. return loginService.customPOST(data, 'sslLogin', {});
  541. },
  542. // logout: function(sessionid,userid){
  543. // return loginService.customPOST(sessionid + '/' + userid);
  544. // },
  545. license: function (data) {
  546. return loginService.customPOST(data, 'license', {});
  547. },
  548. getLicense: function (data) {
  549. return loginService.customPOST(data, 'getLicense', {});
  550. },
  551. sso: function (nickname) {
  552. return loginService.customGET('sso/' + nickname);
  553. },
  554. resetpwd: function (userid) {
  555. return loginService.customGET('resetpwd/' + userid);
  556. },
  557. uppwd: function (data) {
  558. return loginService.customPOST(data, 'uppwd', {});
  559. }
  560. }
  561. }])
  562. app.factory('applyRestangular', function (Restangular) {
  563. return Restangular.withConfig(function (RestangularConfigurer) {
  564. RestangularConfigurer.setBaseUrl(serverIp + '/apply/');
  565. });
  566. });
  567. app.factory('api_apply', ['applyRestangular', function (applyRestangular) {
  568. var applyService = applyRestangular.all("bpm");
  569. return {
  570. wxIncidentReject: function (id, data) {
  571. return applyService.customPOST(data, 'wxIncidentReject/' + id, {});
  572. }
  573. }
  574. }])
  575. app.factory('api_user_data', ['UserRestangular', function (UserRestangular) {
  576. var dataService = UserRestangular.all("user/data");
  577. var userService = UserRestangular.all("auth");
  578. return {
  579. validate: function (data) {
  580. return dataService.customPOST(data, 'validate/role', {});
  581. },
  582. importData: function () {
  583. return dataService.one('/importData');
  584. },
  585. importData1: function (type) {
  586. return dataService.one('/importData/'+type);
  587. },
  588. fetchDataList: function (model, data) {
  589. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  590. },
  591. fetchData: function (model, data) {
  592. return dataService.customPOST(data, 'fetchData/' + model, {});
  593. },
  594. addData: function (model, data) {
  595. return dataService.customPOST(data, 'addData/' + model, {});
  596. },
  597. updData: function (model, data) {
  598. return dataService.customPOST(data, 'updData/' + model, {});
  599. },
  600. rmvData: function (model, data) {
  601. return dataService.customPOST(data, 'rmvData/' + model, {});
  602. },
  603. register: function (data) {
  604. return dataService.customPOST(data, 'register', {});
  605. },
  606. downDataModel: function (type, month) {
  607. return dataService.one('downDataModel/' + type + '/' + month);
  608. },
  609. fetchgetData: function (model, data) {
  610. return dataService.customGET('fetchData/' + model + '/' + data, {});
  611. },
  612. roleMenu: function (model) {
  613. return userService.customGET('roleMenu/' + model, {});
  614. },
  615. pageMenuByCode: function (model) {
  616. return userService.customGET('pageMenuByCode/' + model, {});
  617. },
  618. pageEvent: function (data, model) {
  619. return userService.customPOST(data, 'pageEvent', {});
  620. },
  621. pageMenu: function (data, model) {
  622. return userService.customPOST(data, 'pageMenu', {});
  623. // return userService.one('/pageMenu' + data);
  624. },
  625. getMenu: function (data, model) {
  626. return userService.customPOST(data, 'getMenu', {});
  627. },
  628. getOnlineInfo: function (date) {
  629. return userService.customPOST({}, 'onlineInfo/' + date, {});
  630. }
  631. };
  632. }]);
  633. // app.factory('DpmRestangular', function(Restangular) {
  634. // return Restangular.withConfig(function(RestangularConfigurer) {
  635. // RestangularConfigurer.setBaseUrl(serverIp+':9008/data/');
  636. // });
  637. // });
  638. // app.factory('api_bpm_dbca', ['DpmRestangular', function(DpmRestangular){
  639. // var bpm = DpmRestangular.all("bpm");
  640. // return {
  641. // impFileData: function(pdKey){
  642. // return bpm.customPOST( 'impFileData/' + pdKey);
  643. // },
  644. // };
  645. // }]);
  646. app.factory('BpmRestangular', function (Restangular) {
  647. return Restangular.withConfig(function (RestangularConfigurer) {
  648. // RestangularConfigurer.setBaseUrl("http://168.166.3.41"+':9008/api/');
  649. RestangularConfigurer.setBaseUrl(serverIp + '/bpm');
  650. });
  651. });
  652. app.factory('SimpleRestangular', function (Restangular) {
  653. return Restangular.withConfig(function (RestangularConfigurer) {
  654. RestangularConfigurer.setBaseUrl(serverIp + '/simple');
  655. });
  656. });
  657. app.factory('api_simple', ['SimpleRestangular', function (SimpleRestangular) {
  658. var r_data = SimpleRestangular.all("data");
  659. return {
  660. addListData: function (model, data) {
  661. return r_data.customPOST(data, 'addListData/' + model, {});
  662. },
  663. }
  664. }]);
  665. app.factory('api_statistic', ['BpmRestangular', function (BpmRestangular) {
  666. var statistic = BpmRestangular.all("statistic");
  667. var table = BpmRestangular.all("data");
  668. return {
  669. query: function (data, rptId) {
  670. return statistic.customPOST(data, 'unidimensional/' + rptId, {});
  671. },
  672. // exportData: function(reportView, uuid, reportfileName){
  673. // return reportService.one('query/rest/export/xls/?exportname='+reportfileName+'xls');
  674. // }
  675. getTask: function (userid, idx, sum) {
  676. return table.customGET('getTask/' + userid + '/' + idx + '/' + sum);
  677. },
  678. unidimensionalExport: function (rptId) {
  679. return statistic.one('unidimensionalExport/' + rptId);
  680. },
  681. tableData: function (data, rptId) {
  682. return table.customPOST(data, 'fetchDataList/' + rptId, {});
  683. }
  684. }
  685. }]);
  686. app.factory('api_bpm', ['BpmRestangular', function (BpmRestangular) {
  687. var process = BpmRestangular.all("process");
  688. var postfix = BpmRestangular.all("bpm");
  689. var getData = BpmRestangular.all('data');
  690. var InspectionProcessActual = BpmRestangular.all('InspectionProcessActual');
  691. return {
  692. //巡检列表批量指派
  693. assign: function (data) {
  694. return InspectionProcessActual.customPOST(data, 'batchAssign', {});
  695. },
  696. //获取巡检报告
  697. report: function (data) {
  698. return InspectionProcessActual.customPOST(data, 'report', {});
  699. },
  700. deploy: function (data) {
  701. return process.customPOST(data, 're/model/deploy', {});
  702. },
  703. list: function () {
  704. return process.customGET('re/model/list');
  705. },
  706. modelsource: function (pdId) {
  707. return process.customGET('re/model/' + pdId + '/source');
  708. },
  709. // savemodel: function(pdId, data) {
  710. // return process.customPOST(data, 're/model/' + pdId + '/save', {});
  711. // },
  712. savemodel: function (pdId, data) {
  713. return process.customPOST(data, 'saveModel/' + pdId, {});
  714. },
  715. removemodel: function (modelId) {
  716. return process.customGET('re/model/' + modelId + '/remove');
  717. },
  718. upgrade: function (data, taskId, userId, model) {
  719. return postfix.customPOST(data, model + '/' + taskId + '/' + userId, {});
  720. // return postfix.customPOST(id);
  721. },
  722. fetchDataList: function (model, data) {
  723. return getData.customPOST(data, 'fetchDataList/' + model, {});
  724. },
  725. addData: function (model, data) {
  726. return getData.customPOST(data, 'addData/' + model, {});
  727. },
  728. updData: function (model, data) {
  729. return getData.customPOST(data, 'updData/' + model, {});
  730. },
  731. //判断事件分类层级
  732. tellCategory: function (id) {
  733. return getData.customGET('tellCategory' + '/' + id);
  734. },
  735. //知识库导出
  736. downDataModel: function (type,month) {
  737. return getData.one('downDataModel/' + type + '/' + month);
  738. }
  739. };
  740. }]);
  741. app.factory('CommonRestangular', function (Restangular) {
  742. return Restangular.withConfig(function (RestangularConfigurer) {
  743. RestangularConfigurer.setBaseUrl(serverIp + '/common');
  744. });
  745. });
  746. app.factory('api_bpm_domain', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
  747. var bpmService = BpmRestangular.all("bpm");
  748. var commonService = CommonRestangular.all("common");
  749. return {
  750. //指派
  751. delegateTask: function (pdKey, data) {
  752. return bpmService.customPOST(data, 'delegateTask/' + pdKey, {});
  753. },
  754. fetchtask: function (pdKey, data) {
  755. return bpmService.customPOST(data, 'fetchTask/' + pdKey, {});
  756. },
  757. start: function (pdKey, data) {
  758. return bpmService.customPOST(data, 'start/' + pdKey, {});
  759. },
  760. flowTracing: function (processInstanceId, data) {
  761. return bpmService.customPOST(data, 'flowTracing/' + processInstanceId, {});
  762. },
  763. flowTracingCustom: function (processInstanceId, data) {
  764. return bpmService.customPOST(data, 'flowTracingCustom/' + processInstanceId, {});
  765. },
  766. complete: function (taskId, userId, data) {
  767. return bpmService.customPOST(data, 'completeTask/' + taskId + '/' + userId, {});
  768. },
  769. completeUpgrade: function (data) {
  770. return bpmService.customPOST(data, 'upgradeIncident', {});
  771. },
  772. save: function (taskId, data) {
  773. return bpmService.customPOST(data, 'saveTaskVar/' + taskId, {});
  774. },
  775. claimtask: function (taskId, data) {
  776. return bpmService.customPOST(data, 'claimTask/' + taskId, {});
  777. },
  778. claimAndCompletedTask: function (taskId, data) {
  779. return bpmService.customPOST(data, 'claimAndCompletedTask/' + taskId, {});
  780. },
  781. delegateTask: function (taskId, data) {
  782. return bpmService.customPOST(data, 'delegateTask/' + taskId, {});
  783. },
  784. expectedTime: function (taskId) {
  785. return bpmService.customGET('expectedTime/' + taskId);
  786. },
  787. history: function (processId) {
  788. return bpmService.customGET('history/' + processId);
  789. },
  790. // upgrade: function(processInstanceId, taskId, data) {
  791. // return bpmService.customPOST(data, 'upgradeIncident/' + processInstanceId + '/' + taskId, {});
  792. // },
  793. listAttachments: function (processId, data) {
  794. return commonService.customGET('listAttachment/incident/' + processId, {});
  795. },
  796. listAttachment: function (modal, processId) {
  797. return commonService.customGET('listAttachment/' + modal + '/' + processId);
  798. },
  799. saveAttachments: function (processId, taskId, userId, data) {
  800. return bpmService.one('saveAttachments/' + processId + '/' + taskId + '/' + userId);
  801. },
  802. uploadAttachment: function (processId, taskId, userId, data) {
  803. return commonService.one('uploadAttachment/' + 'incident/' + processId);
  804. },
  805. uploadAttachmentJryModel: function (model, processId, taskId, userId, data) {
  806. return commonService.one('uploadAttachment/' + model + '/' + processId);
  807. },
  808. download: function (attachmentId) {
  809. return bpmService.one('getAttachmentContent/' + attachmentId);
  810. },
  811. // download: function(attachmentId){
  812. // return bpmService.customGET('getAttachmentContent/' + attachmentId,{},{'responseType':'arraybuffer'});
  813. // },
  814. attachmentsPreviewUrl: function (attachmentId) {
  815. return bpmService.customGET('attachmentsPreviewUrl/' + attachmentId);
  816. },
  817. startformkey: function (pdKey) {
  818. return bpmService.customGET('startformkey/' + pdKey);
  819. },
  820. taskformkey: function (taskId) {
  821. return bpmService.customGET('taskformkey/' + taskId);
  822. },
  823. workernumber: function (type) {
  824. return bpmService.customGET('restful/' + type);
  825. },
  826. getWatchAreaPosition: function (data) {
  827. return bpmService.customGET('getWatchAreaPosition');
  828. },
  829. getWatchAreaData: function (id) {
  830. return bpmService.customGET('getWatchAreaData/' + id);
  831. },
  832. // 业务系统附件上传
  833. upload: function (type, processId) {
  834. return commonService.one(type + processId);
  835. },
  836. };
  837. }]);
  838. app.factory('api_bpm_domain1', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
  839. var bpmService = BpmRestangular.all("bpm");
  840. var commonService = CommonRestangular.all("common");
  841. return {
  842. //指派
  843. delegateTask: function (pdKey, data) {
  844. return bpmService.customPOST(data, 'delegateTask/' + pdKey, {});
  845. },
  846. fetchtask: function (pdKey, data) {
  847. return bpmService.customPOST(data, 'fetchTask/' + pdKey, {});
  848. },
  849. start: function (pdKey, data) {
  850. return bpmService.customPOST(data, 'start/' + pdKey, {});
  851. },
  852. flowTracing: function (processInstanceId, data) {
  853. return bpmService.customPOST(data, 'flowTracing/' + processInstanceId, {});
  854. },
  855. flowTracingCustom: function (processInstanceId, data) {
  856. return bpmService.customPOST(data, 'flowTracingCustom/' + processInstanceId, {});
  857. },
  858. complete: function (taskId, userId, data) {
  859. return bpmService.customPOST(data, 'completeTask/' + taskId + '/' + userId, {});
  860. },
  861. completeUpgrade: function (data) {
  862. return bpmService.customPOST(data, 'upgradeIncident', {});
  863. },
  864. save: function (taskId, data) {
  865. return bpmService.customPOST(data, 'saveTaskVar/' + taskId, {});
  866. },
  867. claimtask: function (taskId, data) {
  868. return bpmService.customPOST(data, 'claimTask/' + taskId, {});
  869. },
  870. claimAndCompletedTask: function (taskId, data) {
  871. return bpmService.customPOST(data, 'claimAndCompletedTask/' + taskId, {});
  872. },
  873. delegateTask: function (taskId, data) {
  874. return bpmService.customPOST(data, 'delegateTask/' + taskId, {});
  875. },
  876. expectedTime: function (taskId) {
  877. return bpmService.customGET('expectedTime/' + taskId);
  878. },
  879. history: function (processId) {
  880. return bpmService.customGET('history/' + processId);
  881. },
  882. // upgrade: function(processInstanceId, taskId, data) {
  883. // return bpmService.customPOST(data, 'upgradeIncident/' + processInstanceId + '/' + taskId, {});
  884. // },
  885. listAttachments: function (processId, data) {
  886. return commonService.customGET('listAttachment/inspection/' + processId, {});
  887. },
  888. listAttachment: function (modal, processId) {
  889. return commonService.customGET('listAttachment/' + modal + '/' + processId);
  890. },
  891. saveAttachments: function (processId, taskId, userId, data) {
  892. return bpmService.one('saveAttachments/' + processId + '/' + taskId + '/' + userId);
  893. },
  894. uploadAttachment: function (processId, taskId, userId, data) {
  895. return commonService.one('uploadAttachment/' + 'inspection/' + processId);
  896. },
  897. uploadAttachmentJryModel: function (model, processId, taskId, userId, data) {
  898. return commonService.one('uploadAttachment/' + model + '/' + processId);
  899. },
  900. download: function (attachmentId) {
  901. return bpmService.one('getAttachmentContent/' + attachmentId);
  902. },
  903. // download: function(attachmentId){
  904. // return bpmService.customGET('getAttachmentContent/' + attachmentId,{},{'responseType':'arraybuffer'});
  905. // },
  906. attachmentsPreviewUrl: function (attachmentId) {
  907. return bpmService.customGET('attachmentsPreviewUrl/' + attachmentId);
  908. },
  909. startformkey: function (pdKey) {
  910. return bpmService.customGET('startformkey/' + pdKey);
  911. },
  912. taskformkey: function (taskId) {
  913. return bpmService.customGET('taskformkey/' + taskId);
  914. },
  915. workernumber: function (type) {
  916. return bpmService.customGET('restful/' + type);
  917. },
  918. getWatchAreaPosition: function (data) {
  919. return bpmService.customGET('getWatchAreaPosition');
  920. },
  921. getWatchAreaData: function (id) {
  922. return bpmService.customGET('getWatchAreaData/' + id);
  923. },
  924. // 业务系统附件上传
  925. upload: function (type, processId) {
  926. return commonService.one(type + processId);
  927. },
  928. };
  929. }]);
  930. // 事件富文本框上传
  931. app.factory('api_common_incident', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
  932. var commonService = CommonRestangular.all("common");
  933. return {
  934. upload: function (processId) {
  935. return commonService.one('uploadAttachment/incident/' + processId);
  936. },
  937. uploadResponseUri: function () {
  938. return imgBaseUrl + '/';
  939. },
  940. }
  941. }]);
  942. app.factory('api_bpm_data', ['BpmRestangular', function (BpmRestangular) {
  943. var dataService = BpmRestangular.all("data");
  944. var serviceCatalogue = BpmRestangular.all("ServiceCatalogue");
  945. var inspectionProcessActual = BpmRestangular.all("InspectionProcessActual");
  946. var solutionService = BpmRestangular.all("solution");
  947. return {
  948. // 沟通记录获取callId
  949. getCallRecordId: function (data) {
  950. return dataService.customPOST(data, 'getCallRecordId');
  951. },
  952. // 获取首页今日上班清空
  953. getManagerIndexInfo: function (data) {
  954. return dataService.customPOST(data, 'getManagerIndexInfo');
  955. },
  956. // 不受理数据请求 --jry
  957. notAcceptData: function (data) {
  958. return dataService.customPOST(data, 'updData/alarmIncident');
  959. },
  960. // 获取认证计费数据
  961. sumInfo: function (account) {
  962. return dataService.customPOST({}, 'sumInfo/'+account);
  963. },
  964. impFileData: function () {
  965. return dataService.one('/impFileData/bpm_scheduleorder');
  966. },
  967. importData: function () {
  968. return dataService.one('/impFileData');
  969. },
  970. fetchDataList: function (model, data) {
  971. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  972. },
  973. fetchData: function (model, dataId) {
  974. return dataService.customGET('fetchData/' + model + '/' + dataId);
  975. },
  976. fetchServiceTasks: function (model, data) {
  977. if (!model) {
  978. model = "ALL"
  979. }
  980. return serviceCatalogue.customPOST(data, 'fetchServiceTasks/' + model, {});
  981. },
  982. fetchInspectServiceTasks: function (model, data) {
  983. if (!model) {
  984. model = "ALL"
  985. }
  986. return inspectionProcessActual.customPOST(data, 'fetchServiceTasks/' + model, {});
  987. },
  988. addData: function (model, data) {
  989. return dataService.customPOST(data, 'addData/' + model, {});
  990. },
  991. updData: function (model, data) {
  992. return dataService.customPOST(data, 'updData/' + model, {});
  993. },
  994. rmvData: function (model, data) {
  995. return dataService.customPOST(data, 'rmvData/' + model, {});
  996. },
  997. getCount: function (data) {
  998. return dataService.customPOST(data, 'getCount2', {});
  999. },
  1000. downDataModel: function (type, month) {
  1001. return dataService.one('downDataModel/' + type + '/' + month);
  1002. },
  1003. fetchDataByGroupId: function (data) {
  1004. return dataService.customPOST(data, 'fetchDataByGroupId', {});
  1005. },
  1006. // downDataModel: function(type, month, data) {
  1007. // return dataService.customPOST(data, 'downDataModel/' + type + '/' + month, {}, { 'Accept': 'application/json, text/javascript, */*' });
  1008. // }
  1009. };
  1010. }]);
  1011. app.factory('api_bpm_schedule', ['BpmRestangular', function (BpmRestangular) {
  1012. var dataService = BpmRestangular.all("data");
  1013. return {
  1014. //删除事件
  1015. del: function (id) {
  1016. return dataService.customPOST({}, 'deleteIncident/' + id, {});
  1017. },
  1018. getScheduleClass: function () {
  1019. var data = {
  1020. "idx": "0",
  1021. "sum": "10"
  1022. };
  1023. return dataService.customPOST(data, 'fetchDataList/scheduleclass', {});
  1024. },
  1025. fetchList: function (startTime, endTime, userId, queryKey) {
  1026. var scheduleOrder = {
  1027. "scheduleorder": {
  1028. "startTime": startTime,
  1029. "endTime": endTime
  1030. },
  1031. "idx": "0",
  1032. "sum": "1000"
  1033. };
  1034. if (userId) {
  1035. scheduleOrder['scheduleorder']['user'] = userId;
  1036. }
  1037. if (queryKey) {
  1038. scheduleOrder['scheduleorder']['description'] = queryKey;
  1039. }
  1040. return dataService.customPOST(scheduleOrder, 'fetchDataList/scheduleorder', {});
  1041. },
  1042. fetchData: function (dataId) {
  1043. return dataService.customGET('fetchData/scheduleorder/' + dataId);
  1044. },
  1045. update: function (data) {
  1046. return dataService.customPOST(data, 'updData/scheduleorder', {});
  1047. },
  1048. add: function (data) {
  1049. return dataService.customPOST(data, 'addData/scheduleorder', {});
  1050. },
  1051. remove: function (data) {
  1052. return dataService.customPOST(data, 'rmvData/scheduleorder', {});
  1053. },
  1054. fetchSchedule: function (userId, startTime, endTime) {
  1055. var scheduleData = {
  1056. "schedulewatch": {
  1057. "type": "1",
  1058. "user": {
  1059. "id": userId
  1060. },
  1061. "startTime": startTime,
  1062. "endTime": endTime
  1063. },
  1064. "idx": "0",
  1065. "sum": "100"
  1066. };
  1067. return dataService.customPOST(scheduleData, 'fetchDataList/schedulewatch', {});
  1068. },
  1069. queryRecieveSwitch: function (userId) {
  1070. var handleSwitch = {
  1071. "schedulewatch": {
  1072. "type": "3",
  1073. "user": {
  1074. "id": userId
  1075. }
  1076. },
  1077. "idx": "0",
  1078. "sum": "10"
  1079. };
  1080. return dataService.customPOST(handleSwitch, 'fetchDataList/schedulewatch', {});
  1081. },
  1082. queryHandleoutSwitch: function (userId) {
  1083. var handleSwitch = {
  1084. "schedulewatch": {
  1085. "type": "2",
  1086. "user": {
  1087. "id": userId
  1088. }
  1089. },
  1090. "idx": "0",
  1091. "sum": "10"
  1092. };
  1093. return dataService.customPOST(handleSwitch, 'fetchDataList/schedulewatch', {});
  1094. },
  1095. handleSchedule: function (data) {
  1096. return dataService.customPOST(data, 'updData/schedulewatch', {});
  1097. },
  1098. querySwitch: function (filterData) {
  1099. var switchData = {
  1100. "scheduleorder": {
  1101. "type": "4"
  1102. },
  1103. "idx": filterData.idx,
  1104. "sum": filterData.sum
  1105. };
  1106. return dataService.customPOST(switchData, 'fetchDataList/scheduleorder', {});
  1107. },
  1108. query: function (filterData) {
  1109. var switchData = {
  1110. "scheduleorder": filterData.scheduleorder,
  1111. "idx": filterData.idx,
  1112. "sum": filterData.sum
  1113. };
  1114. return dataService.customPOST(switchData, 'fetchDataList/scheduleorder', {});
  1115. }
  1116. };
  1117. }]);
  1118. app.factory('SysinfoRestangular', function (Restangular) {
  1119. return Restangular.withConfig(function (RestangularConfigurer) {
  1120. RestangularConfigurer.setBaseUrl(serverIp + '/sysinfo/');
  1121. });
  1122. });
  1123. app.factory('api_sysinfo', ['SysinfoRestangular', function (SysinfoRestangular) {
  1124. var dataService = SysinfoRestangular.all("data");
  1125. return {
  1126. fetchDataList: function (model, data) {
  1127. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  1128. },
  1129. addData: function (model, data) {
  1130. return dataService.customPOST(data, 'addData/' + model, {});
  1131. },
  1132. getSerialnumber: function (type, model) {
  1133. return dataService.customGET('getSerialnumber/' + type + '/' + model);
  1134. }
  1135. };
  1136. }]);
  1137. app.factory('ConfigureRestangular', function (Restangular) {
  1138. return Restangular.withConfig(function (RestangularConfigurer) {
  1139. RestangularConfigurer.setBaseUrl(serverIp);
  1140. });
  1141. });
  1142. app.factory('api_configure_form', ['ConfigureRestangular', function (ConfigureRestangular) {
  1143. var formService = ConfigureRestangular.all("form");
  1144. // var formService = ConfigureRestangular.all("bpm/data");
  1145. return {
  1146. renderForm: function (formKey, userId, processInstanceId, id) {
  1147. if (processInstanceId) {
  1148. return formService.customGET('renderForm/' + formKey + "/" + processInstanceId + "/" + userId + "/" + id);
  1149. } else {
  1150. var ids = 0
  1151. return formService.customGET('renderForm/' + formKey + "/000000/" + userId + "/" + ids);
  1152. }
  1153. },
  1154. renderFormNoId: function (formKey, userId, processInstanceId) {
  1155. return formService.customGET('renderForm/' + formKey + "/" + processInstanceId + "/" + userId);
  1156. },
  1157. renderList: function (formKey) {
  1158. return formService.customGET('renderList/' + formKey);
  1159. },
  1160. renderTabForm: function (classify) {
  1161. return formService.customGET('renderTabForm/' + classify);
  1162. }
  1163. };
  1164. }]);
  1165. // app.factory('ConfigureRestangular', function(Restangular) {
  1166. // return Restangular.withConfig(function(RestangularConfigurer) {
  1167. // RestangularConfigurer.setBaseUrl(serverIp + '/config/');
  1168. // });
  1169. // });
  1170. app.factory('api_configure_data', ['ConfigureRestangular', function (ConfigureRestangular) {
  1171. var dataService = ConfigureRestangular.all("data");
  1172. return {
  1173. fetchDataList: function (model, data) {
  1174. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  1175. },
  1176. linkConfigure: function (model, data) {
  1177. return dataService.customPOST(data, 'linkConfigure/' + model, {});
  1178. },
  1179. fetchDataById: function (model, id) {
  1180. return dataService.customGET('fetchData/' + id + '/' + model);
  1181. },
  1182. fetchData: function (model, data) {
  1183. return dataService.customPOST(data, 'fetchData/' + model, {});
  1184. },
  1185. addData: function (model, data) {
  1186. return dataService.customPOST(data, 'addData/' + model, {});
  1187. },
  1188. rmvData: function (model, data) {
  1189. return dataService.customPOST(data, 'rmvData/' + model, {});
  1190. },
  1191. updData: function (model, data) {
  1192. return dataService.customPOST(data, 'updData/' + model, {});
  1193. },
  1194. downModels: function (model, data) {
  1195. return dataService.one(model);
  1196. },
  1197. };
  1198. }]);
  1199. //知识库新接口--jry
  1200. app.factory('ZSKXJKJRY', function (Restangular) {
  1201. return Restangular.withConfig(function (RestangularConfigurer) {
  1202. RestangularConfigurer.setBaseUrl(serverIp + '/solution');
  1203. });
  1204. });
  1205. app.factory('api_zsk', ['ZSKXJKJRY', function (ZSKXJKJRY) {
  1206. //http://127.0.0.1:9004/services/ftpFile/monitor/bankTip/
  1207. var dataList = ZSKXJKJRY.all("fetchDataList");
  1208. var quote = ZSKXJKJRY.all('solutionQuote')
  1209. return {
  1210. jry_get_list: function (data, key) {
  1211. return dataList.customPOST(data, key, {});
  1212. },
  1213. // 知识库分类模糊搜索(暂无,哈哈)
  1214. searchSolutionType: function (data, key) {
  1215. return dataList.customPOST(key, data, {});
  1216. },
  1217. jry_form_getType: function (data, key) {
  1218. return dataList.customPOST({
  1219. "idx": 0,
  1220. "sum": 10000
  1221. }, "solutionType", {});
  1222. },
  1223. solutionData: function (data, key) {
  1224. return dataList.customPOST(data, key, {});
  1225. },
  1226. solutionQuote: function (id) {
  1227. return quote.customGET(id)
  1228. }
  1229. };
  1230. }]);
  1231. app.factory('baseUrl', function (Restangular) {
  1232. return Restangular.withConfig(function (RestangularConfigurer) {
  1233. RestangularConfigurer.setBaseUrl(serverIp + '/');
  1234. });
  1235. });
  1236. app.factory('up_down_file', ['baseUrl', function (baseUrl) {
  1237. var upDownFile = baseUrl.all("");
  1238. return {
  1239. //附件上传新接口
  1240. listAttachment: function (upUrl, bindType, bindId) {
  1241. return upDownFile.customGET(upUrl + '/' + bindType + '/' + bindId);
  1242. },
  1243. listAttachments: function (upUrl, bindType, bindId) {
  1244. return upDownFile.customGET(upUrl + '/' + bindType + '/' + bindId);
  1245. },
  1246. saveAttachments: function (upUrl, bindType, bindId) {
  1247. return upDownFile.one(upUrl + '/' + bindType + '/' + bindId);
  1248. },
  1249. downloadAttachment: function (upUrl, token) {
  1250. return upDownFile.one(upUrl + '/' + token);
  1251. },
  1252. removeAttachment: function (upUrl, token) {
  1253. return upDownFile.one(upUrl + '/' + token);
  1254. }
  1255. };
  1256. }]);
  1257. app.factory('SolutionRestangular', function (Restangular) {
  1258. return Restangular.withConfig(function (RestangularConfigurer) {
  1259. //RestangularConfigurer.setBaseUrl('http://168.166.203.41:9000/services');
  1260. RestangularConfigurer.setBaseUrl(serverIp + '/solution');
  1261. });
  1262. });
  1263. //知识库附件上传--jry
  1264. app.factory('Jry_SolutionRestangular', function (Restangular) {
  1265. return Restangular.withConfig(function (RestangularConfigurer) {
  1266. //RestangularConfigurer.setBaseUrl('http://168.166.203.41:9000/services');
  1267. RestangularConfigurer.setBaseUrl(serverIp + '/common');
  1268. });
  1269. });
  1270. app.factory('api_solution', ['SolutionRestangular', 'Jry_SolutionRestangular', function (SolutionRestangular, Jry_SolutionRestangular) {
  1271. var solutionService = SolutionRestangular.all("solution");
  1272. var jry_bj = SolutionRestangular.all("updData");
  1273. var jry_rm = SolutionRestangular.all("rmvData");
  1274. var jry_getLSJL = SolutionRestangular.all("fetchDataList");
  1275. var jry_sj = SolutionRestangular.all("getVisionNumber");
  1276. var jry_sjup = SolutionRestangular.all("");
  1277. var jry_FJuploda = Jry_SolutionRestangular.all("common");
  1278. var jry_solutionService = SolutionRestangular.all("addData");
  1279. var data = SolutionRestangular.all("solutionData");
  1280. var history = SolutionRestangular.all("solutionHistory");
  1281. var review = SolutionRestangular.all("solution_review");
  1282. var typeservice = SolutionRestangular.all("solutionType");
  1283. var groupservice = SolutionRestangular.all("solutionGroup");
  1284. return {
  1285. findSolutionByKeys: function (data) {
  1286. var key = data.key,
  1287. status = data.status || 0,
  1288. pageIndex = data.pageIndex || 0,
  1289. pageSum = data.pageSum,
  1290. treeIds = data.treeIds,
  1291. userId = data.userId;
  1292. if (angular.isUndefined(treeIds)) {
  1293. return solutionService.customGET('findSolutionByKeys/' + key + '/' + status + '/' + pageIndex + '/' + pageSum + '/' + userId);
  1294. } else {
  1295. return solutionService.customGET('findSolutionByKeys/' + key + '/' + status + '/' + pageIndex + '/' + pageSum + '/' + treeIds + '/' + userId);
  1296. }
  1297. },
  1298. // searcher: function(data){
  1299. // var queryBuilder=data.key, indexname=data.treeIds, type=data.userId;
  1300. // return searchservice.customGET('searcher/' + queryBuilder + '/' + indexname + '/' + type );
  1301. // },
  1302. addSolution: function () {
  1303. return solutionService.one('add');
  1304. },
  1305. addFile: function (data) {
  1306. return solutionService.customPOST(data, 'addSolution', {});
  1307. },
  1308. jry_addFile: function (data) {
  1309. return jry_solutionService.customPOST(data, 'solution', {});
  1310. },
  1311. addData: function (model, data) {
  1312. return jry_solutionService.customPOST(data, model, {});
  1313. },
  1314. addModel: function (type, data) {
  1315. return solutionService.customPOST(data, 'addModel/' + type, {});
  1316. },
  1317. updModel: function (type, data) {
  1318. return solutionService.customPOST(data, 'updModel/' + type, {});
  1319. },
  1320. rmModels: function (id, data) {
  1321. return solutionService.customPOST(data, 'rmModels/' + id, {});
  1322. },
  1323. update: function () {
  1324. return solutionService.one('update');
  1325. },
  1326. upload: function () {
  1327. return solutionService.one('upload');
  1328. },
  1329. jry_upload: function (LCid) {
  1330. return jry_FJuploda.one('uploadAttachment/solution/' + LCid);
  1331. },
  1332. jry_upload1: function (LCid) {
  1333. return jry_FJuploda.one('uploadAttachment/knowledge/' + LCid);
  1334. },
  1335. uploadResponseUri: function () {
  1336. return solutionService.one('/');
  1337. },
  1338. addNotFile: function (data) {
  1339. return solutionService.customPOST(data, 'addNotFile', {});
  1340. },
  1341. // export: function(data) {
  1342. // return solutionService.customGET(data, 'export', {});
  1343. // },
  1344. export: function (data) {
  1345. return solutionService.one('export');
  1346. },
  1347. updateNotFile: function (data) {
  1348. return solutionService.customPOST(data, 'updateNotFile', {});
  1349. },
  1350. updateSolution: function (data) {
  1351. return solutionService.customPOST(data, 'updateSolution', {});
  1352. },
  1353. jry_updateSolution: function (data) {
  1354. return jry_bj.customPOST(data, 'solution', {});
  1355. },
  1356. updData: function (model, data) {
  1357. return jry_bj.customPOST(data, model, {});
  1358. },
  1359. rmvData: function (model, data) {
  1360. return jry_rm.customPOST(data, model, {});
  1361. },
  1362. jry_leveSolution: function (data) {
  1363. return jry_sjup.customPOST(data, 'upgrade', {});
  1364. },
  1365. jry_leveVision: function (id) {
  1366. return jry_sj.customGET(id);
  1367. },
  1368. jry_getHistory: function (data) {
  1369. return jry_getLSJL.customPOST(data, 'solution', {});
  1370. },
  1371. wt_type: function (data) {
  1372. return jry_getLSJL.customPOST(data, 'solutionType', {});
  1373. },
  1374. searchSolutionByKey: function (key, id) {
  1375. return solutionService.customGET('searchSolutionByKey/' + key + '/' + id);
  1376. },
  1377. findSolutionById: function (id) {
  1378. return solutionService.customGET('check/' + id);
  1379. },
  1380. findSolutions: function (id) {
  1381. return solutionService.customGET('check2/' + id);
  1382. },
  1383. jry_fetchDataList: function (model, data) {
  1384. return jry_sjup.customPOST(data, 'fetchDataList/' + model, {});
  1385. },
  1386. fetchDataList: function (model, data) {
  1387. return solutionService.customPOST(data, 'fetchDataList/' + model, {});
  1388. },
  1389. findSolutionDataByDateById: function (ndate, sid) {
  1390. return data.customGET('findSolutionDataByDateById/' + ndate + '/' + sid);
  1391. },
  1392. findSolutionTypeActions: function (userId) {
  1393. return typeservice.customGET('findSolutionTypeActions/' + userId);
  1394. },
  1395. findSolutionTypesUser: function (data) {
  1396. return typeservice.customPOST(data, 'findSolutionTypesUser', {});
  1397. },
  1398. addTypeUserAll: function (data) {
  1399. return typeservice.customPOST(data, 'addTypeUserAll', {});
  1400. },
  1401. hotRanking: function (num) {
  1402. return solutionService.customGET('hotRanking/' + num);
  1403. },
  1404. scoreRanking: function (num) {
  1405. return solutionService.customGET('scoreRanking/' + num);
  1406. },
  1407. fetchBBSSolutions: function (pageIndex, pageSum, sequence, userId) {
  1408. return solutionService.customGET('communicationSolutions/' + pageIndex + '/' + pageSum + '/' + sequence + '/' + userId);
  1409. },
  1410. queryBBSSolutions: function (pageIndex, pageSum, sequence, userId, key) {
  1411. return solutionService.customGET('communicationSolutions/' + pageIndex + '/' + pageSum + '/' + sequence + '/' + userId + '/' + key);
  1412. },
  1413. updateSolutionStatus: function (data) {
  1414. return solutionService.customPOST(data, 'updateSolutionStatus', {});
  1415. },
  1416. getSolutionNumber: function () {
  1417. return solutionService.customGET('getSolutionNumber');
  1418. },
  1419. addSolutionType: function (data) {
  1420. return typeservice.customPOST(data, 'add', {});
  1421. },
  1422. updateSolutionType: function (data) {
  1423. return typeservice.customPOST(data, 'update', {});
  1424. },
  1425. removeSolutionType: function (id) {
  1426. return typeservice.customGET('delete/' + id);
  1427. },
  1428. getSolutionType: function (id) {
  1429. return typeservice.customGET('' + id);
  1430. },
  1431. getTree: function (typeId, groupId, flag) {
  1432. return typeservice.customGET('getTree/' + typeId + '/' + groupId + '/' + flag);
  1433. },
  1434. checkCommentScoreByUserIds: function (userId, id) {
  1435. return review.customGET('findCommentScore/' + userId + '/' + id);
  1436. },
  1437. addSolutionReview: function (data) {
  1438. return solutionService.customPOST(data, 'addScore', {});
  1439. },
  1440. findSolutionReviewById: function (userid, id, pageIndex, pageSum) {
  1441. return solutionService.customGET('findSolutionReviewByType/' + userid + '/' + id + '/' + pageIndex + '/' + pageSum);
  1442. },
  1443. saveAllUserAuth: function (solutionId, flag) {
  1444. return solutionService.customGET('saveAllUserTrees/' + solutionId + '/' + flag);
  1445. },
  1446. updatermvSolutionType: function (typeId, groupId, userIds, flag) {
  1447. return typeservice.customGET('delOrUpdateTrees/' + typeId + '/' + groupId + '/' + userIds + '/' + flag);
  1448. },
  1449. findSolutionGroup: function (id) {
  1450. return groupservice.customGET('findSolutionGroup/' + id);
  1451. },
  1452. saveSolutionGroup: function (id, data) {
  1453. return groupservice.customPOST(data, 'saveSolutionGroup/' + id);
  1454. },
  1455. // getSolutionDowpath: function(id){
  1456. // return solutionService.one('download/'+id);
  1457. // }
  1458. getSolutionDowpath: function (attachmentId) {
  1459. return solutionService.one('download/' + attachmentId + '/file');
  1460. }
  1461. // getSolutionDowpath: function(attachmentId){
  1462. // return solutionService.customGET('download/' + attachmentId);
  1463. // }
  1464. };
  1465. }]);
  1466. // 业务系统
  1467. app.factory('CMDBRestangular2', function (Restangular) {
  1468. return Restangular.withConfig(function (RestangularConfigurer) {
  1469. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb');
  1470. });
  1471. });
  1472. // 业务系统
  1473. app.factory('api_cmdb2', ['CMDBRestangular2', function (CMDBRestangular) {
  1474. var ywxtService = CMDBRestangular.all("operationSystem");
  1475. var ywxtService1 = CMDBRestangular.all("");
  1476. return {
  1477. // 获取绑定到事件上的耗材
  1478. getHc:function(sourceId){
  1479. return ywxtService1.customPOST({
  1480. data: { type: 2, source: "1627", sourceId: sourceId },
  1481. }, 'storeList');
  1482. },
  1483. // 导入模板
  1484. importDataTpl: function (type, data) {
  1485. return ywxtService1.one(type, data, {});
  1486. },
  1487. // 列表数据
  1488. fetchDataList: function (pdKey, data) {
  1489. return ywxtService.customPOST(data, 'fetchDataList/' + pdKey, {})
  1490. },
  1491. // 列表数据
  1492. fetchDataList1: function (pdKey, data) {
  1493. return ywxtService1.customPOST(data, 'fetchDataList/' + pdKey, {})
  1494. },
  1495. // 管理单位
  1496. management_unit: function () {
  1497. return ywxtService.customGET('queryManagementUnit', {});
  1498. },
  1499. // 新增
  1500. add_preservation: function (til, data) {
  1501. return ywxtService.customPOST(data, 'addModel/' + til, {})
  1502. },
  1503. // 新增
  1504. add_preservation1: function (til, data) {
  1505. return ywxtService1.customPOST(data, 'addData/' + til, {})
  1506. },
  1507. // 删除
  1508. remov: function (til, data) {
  1509. return ywxtService.customPOST(data, 'rmModels/' + til, {})
  1510. },
  1511. // 删除
  1512. remov1: function (til, data) {
  1513. return ywxtService1.customPOST(data, 'rmModels/' + til, {})
  1514. },
  1515. // 导出数据
  1516. exportData: function (type, data) {
  1517. return ywxtService.one(type, data, {});
  1518. },
  1519. // 导出数据
  1520. exportData1: function (type, data) {
  1521. return ywxtService1.one(type, data, {});
  1522. },
  1523. // 编辑
  1524. edit_preservation: function (til, data) {
  1525. return ywxtService.customPOST(data, 'updModel/' + til, {})
  1526. },
  1527. // 编辑
  1528. edit_preservation1: function (til, data) {
  1529. return ywxtService1.customPOST(data, 'updData/' + til, {})
  1530. },
  1531. // 修改管理单位
  1532. upd_preservation: function (til, data) {
  1533. return ywxtService1.customPOST(data, 'updData/' + til, {})
  1534. },
  1535. // 删除管理单位
  1536. del_preservation: function (til, data) {
  1537. return ywxtService.customPOST(data, 'rmModels/' + til, {})
  1538. },
  1539. }
  1540. }]);
  1541. // 耗材
  1542. app.factory('CMDBRestangular3', function (Restangular) {
  1543. return Restangular.withConfig(function (RestangularConfigurer) {
  1544. RestangularConfigurer.setBaseUrl(serverIp + '/bpm');
  1545. });
  1546. });
  1547. // 耗材
  1548. app.factory('api_cmdb3', ['CMDBRestangular3', function (CMDBRestangular) {
  1549. var hcService = CMDBRestangular.all("data");
  1550. return {
  1551. // 列表数据
  1552. fetchDataList: function (pdKey, data) {
  1553. return hcService.customPOST(data, 'fetchDataList/' + pdKey, {})
  1554. },
  1555. //编辑保存
  1556. preservation: function (pdKey, data) {
  1557. return hcService.customPOST(data, 'updData/' + pdKey, {})
  1558. },
  1559. //新增
  1560. addData: function (pdKey, data) {
  1561. return hcService.customPOST(data, 'addData/' + pdKey, {})
  1562. },
  1563. // 导出数据
  1564. exportData: function (type, data) {
  1565. return hcService.one(type, data, {});
  1566. },
  1567. // 关联流程
  1568. relation: function (pdKey, data) {
  1569. return hcService.customPOST(data, 'getListBySign/' + pdKey, {})
  1570. }
  1571. }
  1572. }]);
  1573. // 耗材查询分类
  1574. app.factory('CMDBRestangular4', function (Restangular) {
  1575. return Restangular.withConfig(function (RestangularConfigurer) {
  1576. RestangularConfigurer.setBaseUrl(serverIp + '/common');
  1577. });
  1578. })
  1579. // 耗材查询分类
  1580. app.factory('api_cmdb4', ['CMDBRestangular4', function (CMDBRestangular) {
  1581. var hcService = CMDBRestangular.all("common");
  1582. return {
  1583. // 耗材查询分类
  1584. fetchDataList: function (data) {
  1585. return hcService.customPOST(data, 'getDictionary', {})
  1586. },
  1587. // 耗材分类新增
  1588. addDictionary: function (data) {
  1589. return hcService.customPOST(data, 'addDictionary', {})
  1590. },
  1591. // 耗材分类删除修改
  1592. upDictionary: function (data) {
  1593. return hcService.customPOST(data, 'upDictionary', {})
  1594. },
  1595. }
  1596. }]);
  1597. app.factory('CMDBRestangular', function (Restangular) {
  1598. return Restangular.withConfig(function (RestangularConfigurer) {
  1599. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb/');
  1600. });
  1601. });
  1602. app.factory('api_cmdb', ['CMDBRestangular', function (CMDBRestangular) {
  1603. var ciService = CMDBRestangular.all("ci");
  1604. var uuidService = CMDBRestangular.all("uuid");
  1605. var edgeService = CMDBRestangular.all("edge");
  1606. var traversal = CMDBRestangular.all("traversal");
  1607. var downloadService = CMDBRestangular.all("download");
  1608. var exportService = CMDBRestangular.all("export");
  1609. var importService = CMDBRestangular.all("import");
  1610. var exportModelService = CMDBRestangular.all("exportModel");
  1611. var importDataService = CMDBRestangular.all("importData");
  1612. var exportDataService = CMDBRestangular.all("exportData");
  1613. var searchService = CMDBRestangular.all("search");
  1614. function serializeData(data) {
  1615. // If this is not an object, defer to native stringification.
  1616. if (!angular.isObject(data)) {
  1617. return ((data == null) ? "" : data.toString());
  1618. }
  1619. var buffer = [];
  1620. // Serialize each key in the object.
  1621. for (var name in data) {
  1622. if (!data.hasOwnProperty(name)) {
  1623. continue;
  1624. }
  1625. var value = data[name];
  1626. buffer.push(
  1627. encodeURIComponent(name) + "=" + encodeURIComponent((value == null) ? "" : value)
  1628. );
  1629. }
  1630. // Serialize the buffer and clean it up for transportation.
  1631. var source = buffer.join("&").replace(/%20/g, "+");
  1632. return (source);
  1633. }
  1634. return {
  1635. create: function (data) {
  1636. return ciService.customPOST(data, '', {});
  1637. },
  1638. importData: function () {
  1639. return importDataService.one('/nodes');
  1640. },
  1641. put: function (data, id) {
  1642. return ciService.customPUT(data, id, {});
  1643. },
  1644. remove: function (id) {
  1645. return ciService.customDELETE(id);
  1646. },
  1647. removeByUUId: function (uuid) {
  1648. return ciService.customDELETE('uuid/' + id, {}, {
  1649. 'Content-Type': 'application/json'
  1650. });
  1651. },
  1652. removeRefById: function (id) {
  1653. return ciService.customDELETE(id + '/ref');
  1654. },
  1655. find: function (id) {
  1656. return ciService.customGET(id);
  1657. },
  1658. searchkey: function (type, key, idx, sum) {
  1659. return searchService.customGET(type + '/' + key + '/' + idx + '/' + sum);
  1660. },
  1661. findByUUId: function (uuid) {
  1662. return ciService.customGET('?uuid=' + uuid);
  1663. },
  1664. query: function (data) {
  1665. return ciService.customGET('query', data);
  1666. },
  1667. findRefById: function (id) {
  1668. return ciService.customGET(id + '/refs');
  1669. },
  1670. finduuid: function (type, model) {
  1671. return uuidService.customGET(type + '/' + model);
  1672. },
  1673. types: function () {
  1674. return CMDBRestangular.customGET('types');
  1675. },
  1676. createRef: function (data) {
  1677. return edgeService.customPOST(data, '', {});
  1678. },
  1679. putRef: function (data, id) {
  1680. return edgeService.customPUT(data, '' + id, {});
  1681. },
  1682. removeRef: function (id) {
  1683. return edgeService.customDELETE(id, {}, {
  1684. 'Content-Type': 'application/json'
  1685. });
  1686. },
  1687. traversal: function (uuid) {
  1688. return traversal.customGET(uuid);
  1689. },
  1690. traversalRel: function (uuid, relation) {
  1691. return traversal.customGET(uuid + '/' + relation + '/' + 'none');
  1692. },
  1693. export: function (label) {
  1694. return exportService.customGET('nodes/' + label);
  1695. },
  1696. import: function () {
  1697. return importService.one('/nodes');
  1698. },
  1699. download: function (label) {
  1700. return downloadService.one('/label');
  1701. },
  1702. exportData: function (type, model) {
  1703. return exportDataService.one(model + '/' + type);
  1704. },
  1705. downModels: function (type, model) {
  1706. return exportModelService.one(model + '/' + type);
  1707. }
  1708. };
  1709. }]);
  1710. app.factory('CMDBNEWRestangular', function (Restangular) {
  1711. return Restangular.withConfig(function (RestangularConfigurer) {
  1712. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb/');
  1713. });
  1714. });
  1715. app.factory('api_cmdb_new', ['CMDBNEWRestangular', function (CMDBNEWRestangular) {
  1716. var assetService = CMDBNEWRestangular.all("asset");
  1717. var operationSystemService = CMDBNEWRestangular.all('operationSystem')
  1718. return {
  1719. checkFile: function (model) {
  1720. return assetService.one('/checkFile/' + model);
  1721. },
  1722. getApplicationId: function (type) {
  1723. return assetService.customGET('getApplicationId/' + type);
  1724. },
  1725. fetchDataList: function (model, data) {
  1726. return operationSystemService.customPOST(data, 'fetchDataList/' + model, {});
  1727. },
  1728. fetchDataList: function (model, data) {
  1729. return operationSystemService.customPOST(data, 'fetchDataList/' + model, {});
  1730. }
  1731. }
  1732. }]);
  1733. app.factory('MonitorRestangular', function (Restangular) {
  1734. return Restangular.withConfig(function (RestangularConfigurer) {
  1735. RestangularConfigurer.setBaseUrl(serverIp + ':9004/services');
  1736. });
  1737. });
  1738. app.factory('api_monitor', ['MonitorRestangular', function (MonitorRestangular) {
  1739. //http://127.0.0.1:9004/services/ftpFile/monitor/bankTip/
  1740. var process = MonitorRestangular.all("ftpFile/monitor");
  1741. return {
  1742. bankTip: function (id) {
  1743. return process.customGET('bankTip/' + id);
  1744. },
  1745. list: function () {
  1746. return process.customGET('list/1000');
  1747. },
  1748. devList: function (id) {
  1749. return process.customGET('devList/' + id);
  1750. },
  1751. cpuList: function () {
  1752. return process.customGET('cpuList/10');
  1753. },
  1754. memList: function () {
  1755. return process.customGET('memList/10');
  1756. },
  1757. storageList: function () {
  1758. return process.customGET('storageList/10');
  1759. },
  1760. transData: function () {
  1761. return process.customGET('transData/5');
  1762. },
  1763. banklist: function () {
  1764. return process.customGET('banklist');
  1765. },
  1766. app: function (id) {
  1767. return process.customGET('app/' + id);
  1768. },
  1769. beita: function (id) {
  1770. return process.customGET('beita/' + id);
  1771. },
  1772. gongji: function (id) {
  1773. return process.customGET('gongji/' + id);
  1774. }
  1775. };
  1776. }]);
  1777. /**
  1778. * 报表
  1779. */
  1780. app.factory('NxreportRestangular', function (Restangular) {
  1781. return Restangular.withConfig(function (RestangularConfigurer) {
  1782. RestangularConfigurer.setBaseUrl(serverIp);
  1783. });
  1784. });
  1785. app.factory('api_report_nx', ['NxreportRestangular', 'Restangular', function (NxreportRestangular, Restangular) {
  1786. var reportService = NxreportRestangular.all("reportPoc");
  1787. return {
  1788. fetchDataList: function (model, data) { //事件分类
  1789. return reportService.customPOST(data, 'fetchDataList/' + model, {})
  1790. },
  1791. // getPdf: function(data) { //事件分类
  1792. // return reportService.customPOST(data, 'getPdf', {})
  1793. // },
  1794. getPdf: function (model) {
  1795. // return reportService.one('getPdf', {});
  1796. return reportService.one('getPdf', model, {});
  1797. },
  1798. };
  1799. }]);
  1800. // app.factory('NxreportRestangular', function(Restangular) {
  1801. // return Restangular.withConfig(function(RestangularConfigurer) {
  1802. // RestangularConfigurer.setBaseUrl(serverIp);
  1803. // });
  1804. // });
  1805. // app.factory('api_report_nx', ['NxreportRestangular', function(NxreportRestangular) {
  1806. // var nxreport = NxreportRestangular.all("reportPoc");
  1807. // return {
  1808. // fetchDataList: function(data, rptId) {
  1809. // return nxreport.customPOST(data, 'fetchDataList/incidentClassify', {});
  1810. // }
  1811. // }
  1812. // }]);
  1813. app.factory('ReportRestangular', function (Restangular) {
  1814. return Restangular.withConfig(function (RestangularConfigurer) {
  1815. //RestangularConfigurer.setBaseUrl('http://127.0.0.1:9005/api/cmdb/');
  1816. RestangularConfigurer.setBaseUrl(reportIp + ':8080/saiku/rest');
  1817. // RestangularConfigurer.setBaseUrl(serverIp + ':8888/saiku/rest');
  1818. //saiku/rest/saiku/api/query/execute/
  1819. });
  1820. });
  1821. app.factory('api_report', ['ReportRestangular', 'Restangular', function (MonitorRestangular, Restangular) {
  1822. // var reportService = MonitorRestangular.all("saiku/api");
  1823. var authService = MonitorRestangular.one("saiku/session");
  1824. return {
  1825. getLicenseKey: function () {
  1826. // return Restangular.one('assets/').customGET('api/reportToken.js');
  1827. },
  1828. // auth: function(){
  1829. // return authService.customPOST('username=admin&password=admin&language=zh'
  1830. // ,'', {}, {'Content-Type': 'application/x-www-form-urlencoded'});
  1831. // },
  1832. // session: function(){
  1833. // return authService.customGET('');
  1834. // },
  1835. list: function () {
  1836. return reportService.customGET('repository?type=saiku');
  1837. /**
  1838. /saiku/api/repository
  1839. path: /homes/home:admin/itsm_reports
  1840. */
  1841. },
  1842. getMdx: function (path, uuid) {
  1843. var rdata = 'file=' + path + '&formatter=flattened&language=zh';
  1844. return reportService.customPOST(rdata, 'query/' + uuid, {}, {
  1845. 'Content-Type': 'application/x-www-form-urlencoded'
  1846. });
  1847. },
  1848. execute: function (data) {
  1849. return reportService.customPOST(data, 'query/execute', {}, {
  1850. 'Accept': 'application/json, text/javascript, */*'
  1851. });
  1852. },
  1853. exportData: function (reportView, uuid, reportfileName) {
  1854. return reportService.one('query/rest/export/xls/?exportname=' + reportfileName + 'xls');
  1855. }
  1856. };
  1857. }]);
  1858. // 首页仪表盘
  1859. app.factory('ReportnewRestangular', function (Restangular) {
  1860. return Restangular.withConfig(function (RestangularConfigurer) {
  1861. RestangularConfigurer.setBaseUrl(serverIp + '/statistics');
  1862. });
  1863. })
  1864. // 首页仪表盘
  1865. app.factory('api_newreport', ['ReportnewRestangular', function (ReportnewRestangular) {
  1866. var hcService = ReportnewRestangular.all("data");
  1867. return {
  1868. // 事件解决率
  1869. fetchDataList: function (model, data) {
  1870. return hcService.customPOST(data, 'fetchDataList/' + model, {})
  1871. },
  1872. // 首页仪表盘
  1873. addDictionary: function (data) {
  1874. return hcService.customPOST(data, 'addDictionary', {})
  1875. },
  1876. // 首页仪表盘
  1877. upDictionary: function (data) {
  1878. return hcService.customPOST(data, 'upDictionary', {})
  1879. },
  1880. }
  1881. }]);
  1882. // 月度任务导出
  1883. app.factory('TaskRestangular', function (Restangular) {
  1884. return Restangular.withConfig(function (RestangularConfigurer) {
  1885. // RestangularConfigurer.setBaseUrl("http://168.166.3.41"+':9008/api/');
  1886. RestangularConfigurer.setBaseUrl(serverIp + '/task');
  1887. });
  1888. });
  1889. app.factory('api_task_export', ['TaskRestangular', function (TaskRestangular) {
  1890. var dataService = TaskRestangular.all("data");
  1891. return {
  1892. taskExport: function (model, dataId) {
  1893. return dataService.one(model + '/' + dataId);
  1894. },
  1895. // 任务清单
  1896. yearListSee: function (year, month) {
  1897. return dataService.customGET('previewTask/' + year + '/' + month);
  1898. },
  1899. // 任务清单导出
  1900. yearListExport: function (year, month) {
  1901. return dataService.one('exportTask' + '/' + year + '/' + month);
  1902. }
  1903. };
  1904. }]);
  1905. // 文档管理接口
  1906. app.factory('DocRestangular', function (Restangular) {
  1907. return Restangular.withConfig(function (RestangularConfigurer) {
  1908. // RestangularConfigurer.setBaseUrl("http://168.166.3.41"+':9008/api/');
  1909. RestangularConfigurer.setBaseUrl(serverIp + '/doc');
  1910. });
  1911. });
  1912. app.factory('api_doc_data', ['DocRestangular', function (DocRestangular) {
  1913. var dataService = DocRestangular.all("data");
  1914. return {
  1915. // 删除历史版本
  1916. delileVersion: function (data) {
  1917. return dataService.customPOST(data, 'delileVersion', {});
  1918. },
  1919. // 引入文件
  1920. insertIndexFile: function (data) {
  1921. return dataService.customPOST(data, 'insertIndexFile', {});
  1922. },
  1923. // 搜索统一接口
  1924. selectContent: function (data) {
  1925. return dataService.customPOST(data, 'selectContent', {});
  1926. },
  1927. // 文件历史读取
  1928. fileVersion: function (data) {
  1929. return dataService.customPOST(data, 'fileVersion', {});
  1930. },
  1931. // 文件下载
  1932. download: function (data) {
  1933. return dataService.one('downloadFile')
  1934. },
  1935. // 文件更新
  1936. newDoc: function (fileId) {
  1937. return dataService.one('updateFile')
  1938. },
  1939. // 文件导入
  1940. uploadDoc: function (docId) {
  1941. return dataService.one('importFile', docId)
  1942. },
  1943. // 文件导入附带上传者id
  1944. jry_uploadDoc: function (docId, userId) {
  1945. return dataService.one('importFile' + '/' + docId + '/' + userId)
  1946. },
  1947. //文件更换目录
  1948. jry_filesChange: function (id, data) {
  1949. return dataService.customPOST(data, 'refolder/' + id, {});
  1950. },
  1951. // 索引更换目录
  1952. jry_indexesChange: function (oldId, newId, data) {
  1953. return dataService.customPOST(data, 'refolder/' + oldId + '/' + newId, {});
  1954. },
  1955. fetchDataList: function (model, data) {
  1956. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  1957. },
  1958. data: function (model, data) {
  1959. return dataService.customPOST(data, model, {});
  1960. },
  1961. };
  1962. }]);
  1963. // 消息通知管理
  1964. app.factory('notificationApi', function (Restangular) {
  1965. return Restangular.withConfig(function (RestangularConfigurer) {
  1966. RestangularConfigurer.setBaseUrl(serverIp + '/bpm');
  1967. });
  1968. });
  1969. app.factory('api_notification_data', ['notificationApi', function (notificationApi) {
  1970. var dataService = notificationApi.all("data");
  1971. return {
  1972. // 获取消息通知列表
  1973. fetchDataList: function (data) {
  1974. return dataService.customPOST(data, 'fetchDataList/messageManager');
  1975. },
  1976. // 修改消息通知
  1977. updData: function (data) {
  1978. return dataService.customPOST(data, 'updData/messageManager');
  1979. }
  1980. };
  1981. }]);
  1982. // 事件报表-seimin
  1983. app.factory('eventFormApi', function (Restangular) {
  1984. return Restangular.withConfig(function (RestangularConfigurer) {
  1985. RestangularConfigurer.setBaseUrl(serverIp + '/statistics');
  1986. });
  1987. });
  1988. app.factory('api_event_form', ['eventFormApi', function (eventFormApi) {
  1989. var dataService = eventFormApi.all("data");
  1990. return {
  1991. // 事件总数
  1992. fetchSjzsList: function (data) {
  1993. return dataService.customPOST(data, 'mdv2_incident_repot_sum');
  1994. },
  1995. // 事件类型
  1996. fetchSjlxList: function (data) {
  1997. return dataService.customPOST(data, 'mdv2_incident_repot_type');
  1998. },
  1999. // 处理人/组
  2000. fetchClrzList: function (data) {
  2001. return dataService.customPOST(data, 'mdv2_incident_repot_handle');
  2002. },
  2003. // 三方公司
  2004. fetchSfgsList: function (data) {
  2005. return dataService.customPOST(data, 'mdv2_incident_repot_company');
  2006. },
  2007. // 区域地点
  2008. fetchQyddList: function (data) {
  2009. return dataService.customPOST(data, 'mdv2_incident_repot_area_place');
  2010. },
  2011. // 事件来源
  2012. fetchSjlyList: function (data) {
  2013. return dataService.customPOST(data, 'mdv2_incident_repot_source');
  2014. },
  2015. // 查询事件总数(单个页面只有事件数量)
  2016. getSjNum: function (data) {
  2017. return dataService.customPOST(data, 'mdv2_incident_sum');
  2018. },
  2019. // 综合统计
  2020. fetchZhtjList: function (data) {
  2021. return dataService.customPOST(data, 'mdv2_service_repot_all');
  2022. },
  2023. // 电话统计
  2024. fetchDhtjList: function (data) {
  2025. return dataService.customPOST(data, 'mdv2_service_repot_phone');
  2026. },
  2027. // 微信/WEB统计
  2028. fetchWebList: function (data) {
  2029. return dataService.customPOST(data, 'mdv2_service_repot_wechat_web');
  2030. },
  2031. // 电话留言统计
  2032. fetchDhlytjList: function (data) {
  2033. return dataService.customPOST(data, 'mdv2_service_repot_msg');
  2034. }
  2035. };
  2036. }]);
  2037. // 服务台分析-seimin
  2038. app.factory('deckReportApi', function (Restangular) {
  2039. return Restangular.withConfig(function (RestangularConfigurer) {
  2040. RestangularConfigurer.setBaseUrl(serverIp + '/statistics');
  2041. });
  2042. });
  2043. app.factory('api_deck_report', ['deckReportApi', function (deckReportApi) {
  2044. var dataService = deckReportApi.all("data");
  2045. return {
  2046. // 来电总数
  2047. fetchLdzsNumList: function (data) {
  2048. return dataService.customPOST(data, 'service_phone_total');
  2049. },
  2050. };
  2051. }]);
  2052. // 登录后判断版本-seimin
  2053. app.factory('isCategoryApi', function (Restangular) {
  2054. return Restangular.withConfig(function (RestangularConfigurer) {
  2055. RestangularConfigurer.setBaseUrl(serverIp + '/sysinfo');
  2056. });
  2057. });
  2058. app.factory('api_is_category', ['isCategoryApi', function (isCategoryApi) {
  2059. var dataService = isCategoryApi.all("data");
  2060. return {
  2061. //判断处理人、处理科室seimin
  2062. isCategory: function (data) {
  2063. return dataService.customPOST(data, 'fetchDataList/systemConfiguration');
  2064. }
  2065. };
  2066. }]);
  2067. // 搜索科室列表-seimin
  2068. app.factory('searchKs', function (Restangular) {
  2069. return Restangular.withConfig(function (RestangularConfigurer) {
  2070. RestangularConfigurer.setBaseUrl(serverIp + '/user');
  2071. });
  2072. });
  2073. app.factory('api_search_ks', ['searchKs', function (searchKs) {
  2074. var dataService = searchKs.all("data");
  2075. return {
  2076. //获取科室列表
  2077. getKsList: function (data) {
  2078. return dataService.customPOST(data, 'fetchDataList/department');
  2079. }
  2080. };
  2081. }]);
  2082. // 搜索故障地点seimin
  2083. app.factory('searchArea', function (Restangular) {
  2084. return Restangular.withConfig(function (RestangularConfigurer) {
  2085. RestangularConfigurer.setBaseUrl(serverIp + '/apply');
  2086. });
  2087. });
  2088. app.factory('api_search_area', ['searchArea', function (searchArea) {
  2089. var dataService = searchArea.all("bpm");
  2090. return {
  2091. //获取故障地点
  2092. getAreaList: function (data) {
  2093. return dataService.customPOST(data, 'searchFaultLocation');
  2094. }
  2095. };
  2096. }]);
  2097. // 微信配置查询接口seimin
  2098. app.factory('wechatConfig', function (Restangular) {
  2099. return Restangular.withConfig(function (RestangularConfigurer) {
  2100. RestangularConfigurer.setBaseUrl(serverIp + '/wechat');
  2101. });
  2102. });
  2103. app.factory('api_wechat_operate', ['wechatConfig', function (wechatConfig) {
  2104. var dataService = wechatConfig.all("data");
  2105. return {
  2106. //获取微信配置信息
  2107. getWechatList: function (data) {
  2108. return dataService.customPOST(data, 'fetchDataList/wechatConfig');
  2109. },
  2110. //修改微信配置
  2111. postWxList: function (data) {
  2112. return dataService.customPOST(data, 'addData/wechatConfig');
  2113. }
  2114. };
  2115. }]);
  2116. // 微信配置获取角色seimin
  2117. app.factory('wxRole', function (Restangular) {
  2118. return Restangular.withConfig(function (RestangularConfigurer) {
  2119. RestangularConfigurer.setBaseUrl(serverIp + '/user');
  2120. });
  2121. });
  2122. app.factory('api_wx_role', ['wxRole', function (wxRole) {
  2123. var dataService = wxRole.all("data");
  2124. return {
  2125. //获取微信配置获取角色
  2126. getWxRole: function (data) {
  2127. return dataService.customPOST(data, 'fetchDataList/role');
  2128. }
  2129. };
  2130. }]);
  2131. // CMDB打印
  2132. app.factory('cmdbPrit', function (Restangular) {
  2133. return Restangular.withConfig(function (RestangularConfigurer) {
  2134. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb');
  2135. });
  2136. });
  2137. app.factory('api_cmdb_print', ['cmdbPrit', function (cmdbPrit) {
  2138. var dataService = cmdbPrit.all("ci");
  2139. return {
  2140. //CMDB打印
  2141. getCmdbPrit: function (data) {
  2142. return dataService.customGET('qrcode/' + data);
  2143. }
  2144. };
  2145. }]);