main.js 84 KB

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