main.js 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183
  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('SimpleRestangular', function (Restangular) {
  603. return Restangular.withConfig(function (RestangularConfigurer) {
  604. RestangularConfigurer.setBaseUrl(serverIp + '/simple');
  605. });
  606. });
  607. app.factory('api_simple', ['SimpleRestangular', function (SimpleRestangular) {
  608. var r_data = SimpleRestangular.all("data");
  609. return {
  610. addListData: function (model, data) {
  611. return r_data.customPOST(data, 'addListData/' + model, {});
  612. },
  613. fetchDataList: function (model, data) {
  614. return r_data.customPOST(data, 'fetchDataList/' + model, {});
  615. },
  616. fetchData: function (model, data) {
  617. return r_data.customPOST(data, 'fetchData/' + model, {});
  618. },
  619. addData: function (model, data) {
  620. return r_data.customPOST(data, 'addData/' + model, {});
  621. },
  622. updData: function (model, data) {
  623. return r_data.customPOST(data, 'updData/' + model, {});
  624. },
  625. rmvData: function (model, data) {
  626. return r_data.customPOST(data, 'rmvData/' + model, {});
  627. },
  628. }
  629. }]);
  630. app.factory('BpmRestangular', function (Restangular) {
  631. return Restangular.withConfig(function (RestangularConfigurer) {
  632. // RestangularConfigurer.setBaseUrl("http://168.166.3.41"+':9008/api/');
  633. RestangularConfigurer.setBaseUrl(serverIp + '/bpm');
  634. });
  635. });
  636. app.factory('api_statistic', ['BpmRestangular', function (BpmRestangular) {
  637. var statistic = BpmRestangular.all("statistic");
  638. var table = BpmRestangular.all("data");
  639. return {
  640. query: function (data, rptId) {
  641. return statistic.customPOST(data, 'unidimensional/' + rptId, {});
  642. },
  643. // exportData: function(reportView, uuid, reportfileName){
  644. // return reportService.one('query/rest/export/xls/?exportname='+reportfileName+'xls');
  645. // }
  646. getTask: function (userid, idx, sum) {
  647. return table.customGET('getTask/' + userid + '/' + idx + '/' + sum);
  648. },
  649. unidimensionalExport: function (rptId) {
  650. return statistic.one('unidimensionalExport/' + rptId);
  651. },
  652. tableData: function (data, rptId) {
  653. return table.customPOST(data, 'fetchDataList/' + rptId, {});
  654. }
  655. }
  656. }]);
  657. app.factory('api_bpm', ['BpmRestangular', function (BpmRestangular) {
  658. var process = BpmRestangular.all("process");
  659. var postfix = BpmRestangular.all("bpm");
  660. var getData = BpmRestangular.all('data');
  661. var InspectionProcessActual = BpmRestangular.all('InspectionProcessActual');
  662. return {
  663. //巡检列表批量指派
  664. assign: function (data) {
  665. return InspectionProcessActual.customPOST(data, 'batchAssign', {});
  666. },
  667. //获取巡检报告
  668. report: function (data) {
  669. return InspectionProcessActual.customPOST(data, 'report', {});
  670. },
  671. deploy: function (data) {
  672. return process.customPOST(data, 're/model/deploy', {});
  673. },
  674. list: function () {
  675. return process.customGET('re/model/list');
  676. },
  677. modelsource: function (pdId) {
  678. return process.customGET('re/model/' + pdId + '/source');
  679. },
  680. // savemodel: function(pdId, data) {
  681. // return process.customPOST(data, 're/model/' + pdId + '/save', {});
  682. // },
  683. savemodel: function (pdId, data) {
  684. return process.customPOST(data, 'saveModel/' + pdId, {});
  685. },
  686. removemodel: function (modelId) {
  687. return process.customGET('re/model/' + modelId + '/remove');
  688. },
  689. upgrade: function (data, taskId, userId, model) {
  690. return postfix.customPOST(data, model + '/' + taskId + '/' + userId, {});
  691. // return postfix.customPOST(id);
  692. },
  693. fetchDataList: function (model, data) {
  694. return getData.customPOST(data, 'fetchDataList/' + model, {});
  695. },
  696. addData: function (model, data) {
  697. return getData.customPOST(data, 'addData/' + model, {});
  698. },
  699. updData: function (model, data) {
  700. return getData.customPOST(data, 'updData/' + model, {});
  701. },
  702. //判断事件分类层级
  703. tellCategory: function (id) {
  704. return getData.customGET('tellCategory' + '/' + id);
  705. },
  706. //知识库导出
  707. downDataModel: function (type,month) {
  708. return getData.one('downDataModel/' + type + '/' + month);
  709. }
  710. };
  711. }]);
  712. app.factory('CommonRestangular', function (Restangular) {
  713. return Restangular.withConfig(function (RestangularConfigurer) {
  714. RestangularConfigurer.setBaseUrl(serverIp + '/common');
  715. });
  716. });
  717. app.factory('api_bpm_domain', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
  718. var bpmService = BpmRestangular.all("bpm");
  719. var commonService = CommonRestangular.all("common");
  720. return {
  721. //指派
  722. delegateTask: function (pdKey, data) {
  723. return bpmService.customPOST(data, 'delegateTask/' + pdKey, {});
  724. },
  725. fetchtask: function (pdKey, data) {
  726. return bpmService.customPOST(data, 'fetchTask/' + pdKey, {});
  727. },
  728. start: function (pdKey, data) {
  729. return bpmService.customPOST(data, 'start/' + pdKey, {});
  730. },
  731. flowTracing: function (processInstanceId, data) {
  732. return bpmService.customPOST(data, 'flowTracing/' + processInstanceId, {});
  733. },
  734. flowTracingCustom: function (processInstanceId, data) {
  735. return bpmService.customPOST(data, 'flowTracingCustom/' + processInstanceId, {});
  736. },
  737. complete: function (taskId, userId, data) {
  738. return bpmService.customPOST(data, 'completeTask/' + taskId + '/' + userId, {});
  739. },
  740. completeUpgrade: function (data) {
  741. return bpmService.customPOST(data, 'upgradeIncident', {});
  742. },
  743. save: function (taskId, data) {
  744. return bpmService.customPOST(data, 'saveTaskVar/' + taskId, {});
  745. },
  746. claimtask: function (taskId, data) {
  747. return bpmService.customPOST(data, 'claimTask/' + taskId, {});
  748. },
  749. claimAndCompletedTask: function (taskId, data) {
  750. return bpmService.customPOST(data, 'claimAndCompletedTask/' + taskId, {});
  751. },
  752. delegateTask: function (taskId, data) {
  753. return bpmService.customPOST(data, 'delegateTask/' + taskId, {});
  754. },
  755. expectedTime: function (taskId) {
  756. return bpmService.customGET('expectedTime/' + taskId);
  757. },
  758. history: function (processId) {
  759. return bpmService.customGET('history/' + processId);
  760. },
  761. // upgrade: function(processInstanceId, taskId, data) {
  762. // return bpmService.customPOST(data, 'upgradeIncident/' + processInstanceId + '/' + taskId, {});
  763. // },
  764. listAttachments: function (processId, data) {
  765. return commonService.customGET('listAttachment/incident/' + processId, {});
  766. },
  767. listAttachment: function (modal, processId) {
  768. return commonService.customGET('listAttachment/' + modal + '/' + processId);
  769. },
  770. saveAttachments: function (processId, taskId, userId, data) {
  771. return bpmService.one('saveAttachments/' + processId + '/' + taskId + '/' + userId);
  772. },
  773. uploadAttachment: function (processId, taskId, userId, data) {
  774. return commonService.one('uploadAttachment/' + 'incident/' + processId);
  775. },
  776. uploadAttachmentJryModel: function (model, processId, taskId, userId, data) {
  777. return commonService.one('uploadAttachment/' + model + '/' + processId);
  778. },
  779. download: function (attachmentId) {
  780. return bpmService.one('getAttachmentContent/' + attachmentId);
  781. },
  782. // download: function(attachmentId){
  783. // return bpmService.customGET('getAttachmentContent/' + attachmentId,{},{'responseType':'arraybuffer'});
  784. // },
  785. attachmentsPreviewUrl: function (attachmentId) {
  786. return bpmService.customGET('attachmentsPreviewUrl/' + attachmentId);
  787. },
  788. startformkey: function (pdKey) {
  789. return bpmService.customGET('startformkey/' + pdKey);
  790. },
  791. taskformkey: function (taskId) {
  792. return bpmService.customGET('taskformkey/' + taskId);
  793. },
  794. workernumber: function (type) {
  795. return bpmService.customGET('restful/' + type);
  796. },
  797. getWatchAreaPosition: function (data) {
  798. return bpmService.customGET('getWatchAreaPosition');
  799. },
  800. getWatchAreaData: function (id) {
  801. return bpmService.customGET('getWatchAreaData/' + id);
  802. },
  803. // 业务系统附件上传
  804. upload: function (type, processId) {
  805. return commonService.one(type + processId);
  806. },
  807. };
  808. }]);
  809. app.factory('api_bpm_domain1', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
  810. var bpmService = BpmRestangular.all("bpm");
  811. var commonService = CommonRestangular.all("common");
  812. return {
  813. //指派
  814. delegateTask: function (pdKey, data) {
  815. return bpmService.customPOST(data, 'delegateTask/' + pdKey, {});
  816. },
  817. fetchtask: function (pdKey, data) {
  818. return bpmService.customPOST(data, 'fetchTask/' + pdKey, {});
  819. },
  820. start: function (pdKey, data) {
  821. return bpmService.customPOST(data, 'start/' + pdKey, {});
  822. },
  823. flowTracing: function (processInstanceId, data) {
  824. return bpmService.customPOST(data, 'flowTracing/' + processInstanceId, {});
  825. },
  826. flowTracingCustom: function (processInstanceId, data) {
  827. return bpmService.customPOST(data, 'flowTracingCustom/' + processInstanceId, {});
  828. },
  829. complete: function (taskId, userId, data) {
  830. return bpmService.customPOST(data, 'completeTask/' + taskId + '/' + userId, {});
  831. },
  832. completeUpgrade: function (data) {
  833. return bpmService.customPOST(data, 'upgradeIncident', {});
  834. },
  835. save: function (taskId, data) {
  836. return bpmService.customPOST(data, 'saveTaskVar/' + taskId, {});
  837. },
  838. claimtask: function (taskId, data) {
  839. return bpmService.customPOST(data, 'claimTask/' + taskId, {});
  840. },
  841. claimAndCompletedTask: function (taskId, data) {
  842. return bpmService.customPOST(data, 'claimAndCompletedTask/' + taskId, {});
  843. },
  844. delegateTask: function (taskId, data) {
  845. return bpmService.customPOST(data, 'delegateTask/' + taskId, {});
  846. },
  847. expectedTime: function (taskId) {
  848. return bpmService.customGET('expectedTime/' + taskId);
  849. },
  850. history: function (processId) {
  851. return bpmService.customGET('history/' + processId);
  852. },
  853. // upgrade: function(processInstanceId, taskId, data) {
  854. // return bpmService.customPOST(data, 'upgradeIncident/' + processInstanceId + '/' + taskId, {});
  855. // },
  856. listAttachments: function (processId, data) {
  857. return commonService.customGET('listAttachment/inspection/' + processId, {});
  858. },
  859. listAttachment: function (modal, processId) {
  860. return commonService.customGET('listAttachment/' + modal + '/' + processId);
  861. },
  862. saveAttachments: function (processId, taskId, userId, data) {
  863. return bpmService.one('saveAttachments/' + processId + '/' + taskId + '/' + userId);
  864. },
  865. uploadAttachment: function (processId, taskId, userId, data) {
  866. return commonService.one('uploadAttachment/' + 'inspection/' + processId);
  867. },
  868. uploadAttachmentJryModel: function (model, processId, taskId, userId, data) {
  869. return commonService.one('uploadAttachment/' + model + '/' + processId);
  870. },
  871. download: function (attachmentId) {
  872. return bpmService.one('getAttachmentContent/' + attachmentId);
  873. },
  874. // download: function(attachmentId){
  875. // return bpmService.customGET('getAttachmentContent/' + attachmentId,{},{'responseType':'arraybuffer'});
  876. // },
  877. attachmentsPreviewUrl: function (attachmentId) {
  878. return bpmService.customGET('attachmentsPreviewUrl/' + attachmentId);
  879. },
  880. startformkey: function (pdKey) {
  881. return bpmService.customGET('startformkey/' + pdKey);
  882. },
  883. taskformkey: function (taskId) {
  884. return bpmService.customGET('taskformkey/' + taskId);
  885. },
  886. workernumber: function (type) {
  887. return bpmService.customGET('restful/' + type);
  888. },
  889. getWatchAreaPosition: function (data) {
  890. return bpmService.customGET('getWatchAreaPosition');
  891. },
  892. getWatchAreaData: function (id) {
  893. return bpmService.customGET('getWatchAreaData/' + id);
  894. },
  895. // 业务系统附件上传
  896. upload: function (type, processId) {
  897. return commonService.one(type + processId);
  898. },
  899. };
  900. }]);
  901. // 事件富文本框上传
  902. app.factory('api_common_incident', ['BpmRestangular', 'CommonRestangular', function (BpmRestangular, CommonRestangular) {
  903. var commonService = CommonRestangular.all("common");
  904. return {
  905. upload: function (processId) {
  906. return commonService.one('uploadAttachment/incident/' + processId);
  907. },
  908. uploadResponseUri: function () {
  909. return imgBaseUrl + '/';
  910. },
  911. }
  912. }]);
  913. app.factory('api_bpm_data', ['BpmRestangular', function (BpmRestangular) {
  914. var dataService = BpmRestangular.all("data");
  915. var serviceCatalogue = BpmRestangular.all("ServiceCatalogue");
  916. var inspectionProcessActual = BpmRestangular.all("InspectionProcessActual");
  917. var solutionService = BpmRestangular.all("solution");
  918. return {
  919. // 服务台绩效
  920. serviceCount: function (data) {
  921. return dataService.customPOST(data, 'serviceCount');
  922. },
  923. // 执行一次
  924. executeOnce: function (data) {
  925. return dataService.customPOST(data, 'triggerInspection');
  926. },
  927. // 获取首页今日上班清空
  928. getManagerIndexInfo: function (data) {
  929. return dataService.customPOST(data, 'getManagerIndexInfo');
  930. },
  931. // 不受理数据请求 --jry
  932. notAcceptData: function (data) {
  933. return dataService.customPOST(data, 'updData/alarmIncident');
  934. },
  935. // 获取认证计费数据
  936. sumInfo: function (account) {
  937. return dataService.customPOST({}, 'sumInfo/'+account);
  938. },
  939. impFileData: function () {
  940. return dataService.one('/impFileData/bpm_scheduleorder');
  941. },
  942. importData: function () {
  943. return dataService.one('/impFileData');
  944. },
  945. fetchDataList: function (model, data) {
  946. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  947. },
  948. fetchData: function (model, dataId) {
  949. return dataService.customGET('fetchData/' + model + '/' + dataId);
  950. },
  951. fetchServiceTasks: function (model, data) {
  952. if (!model) {
  953. model = "ALL"
  954. }
  955. return serviceCatalogue.customPOST(data, 'fetchServiceTasks/' + model, {});
  956. },
  957. fetchInspectServiceTasks: function (model, data) {
  958. if (!model) {
  959. model = "ALL"
  960. }
  961. return inspectionProcessActual.customPOST(data, 'fetchServiceTasks/' + model, {});
  962. },
  963. addData: function (model, data) {
  964. return dataService.customPOST(data, 'addData/' + model, {});
  965. },
  966. updData: function (model, data) {
  967. return dataService.customPOST(data, 'updData/' + model, {});
  968. },
  969. rmvData: function (model, data) {
  970. return dataService.customPOST(data, 'rmvData/' + model, {});
  971. },
  972. getCount: function (data) {
  973. return dataService.customPOST(data, 'getCount2', {});
  974. },
  975. downDataModel: function (type, month) {
  976. return dataService.one('downDataModel/' + type + '/' + month);
  977. },
  978. fetchDataByGroupId: function (data) {
  979. return dataService.customPOST(data, 'fetchDataByGroupId', {});
  980. },
  981. // downDataModel: function(type, month, data) {
  982. // return dataService.customPOST(data, 'downDataModel/' + type + '/' + month, {}, { 'Accept': 'application/json, text/javascript, */*' });
  983. // }
  984. };
  985. }]);
  986. app.factory('api_bpm_schedule', ['BpmRestangular', function (BpmRestangular) {
  987. var dataService = BpmRestangular.all("data");
  988. return {
  989. //删除事件
  990. del: function (id) {
  991. return dataService.customPOST({}, 'deleteIncident/' + id, {});
  992. },
  993. getScheduleClass: function () {
  994. var data = {
  995. "idx": "0",
  996. "sum": "10"
  997. };
  998. return dataService.customPOST(data, 'fetchDataList/scheduleclass', {});
  999. },
  1000. fetchList: function (startTime, endTime, userId, queryKey) {
  1001. var scheduleOrder = {
  1002. "scheduleorder": {
  1003. "startTime": startTime,
  1004. "endTime": endTime
  1005. },
  1006. "idx": "0",
  1007. "sum": "1000"
  1008. };
  1009. if (userId) {
  1010. scheduleOrder['scheduleorder']['user'] = userId;
  1011. }
  1012. if (queryKey) {
  1013. scheduleOrder['scheduleorder']['description'] = queryKey;
  1014. }
  1015. return dataService.customPOST(scheduleOrder, 'fetchDataList/scheduleorder', {});
  1016. },
  1017. fetchData: function (dataId) {
  1018. return dataService.customGET('fetchData/scheduleorder/' + dataId);
  1019. },
  1020. update: function (data) {
  1021. return dataService.customPOST(data, 'updData/scheduleorder', {});
  1022. },
  1023. add: function (data) {
  1024. return dataService.customPOST(data, 'addData/scheduleorder', {});
  1025. },
  1026. remove: function (data) {
  1027. return dataService.customPOST(data, 'rmvData/scheduleorder', {});
  1028. },
  1029. fetchSchedule: function (userId, startTime, endTime) {
  1030. var scheduleData = {
  1031. "schedulewatch": {
  1032. "type": "1",
  1033. "user": {
  1034. "id": userId
  1035. },
  1036. "startTime": startTime,
  1037. "endTime": endTime
  1038. },
  1039. "idx": "0",
  1040. "sum": "100"
  1041. };
  1042. return dataService.customPOST(scheduleData, 'fetchDataList/schedulewatch', {});
  1043. },
  1044. queryRecieveSwitch: function (userId) {
  1045. var handleSwitch = {
  1046. "schedulewatch": {
  1047. "type": "3",
  1048. "user": {
  1049. "id": userId
  1050. }
  1051. },
  1052. "idx": "0",
  1053. "sum": "10"
  1054. };
  1055. return dataService.customPOST(handleSwitch, 'fetchDataList/schedulewatch', {});
  1056. },
  1057. queryHandleoutSwitch: function (userId) {
  1058. var handleSwitch = {
  1059. "schedulewatch": {
  1060. "type": "2",
  1061. "user": {
  1062. "id": userId
  1063. }
  1064. },
  1065. "idx": "0",
  1066. "sum": "10"
  1067. };
  1068. return dataService.customPOST(handleSwitch, 'fetchDataList/schedulewatch', {});
  1069. },
  1070. handleSchedule: function (data) {
  1071. return dataService.customPOST(data, 'updData/schedulewatch', {});
  1072. },
  1073. querySwitch: function (filterData) {
  1074. var switchData = {
  1075. "scheduleorder": {
  1076. "type": "4"
  1077. },
  1078. "idx": filterData.idx,
  1079. "sum": filterData.sum
  1080. };
  1081. return dataService.customPOST(switchData, 'fetchDataList/scheduleorder', {});
  1082. },
  1083. query: function (filterData) {
  1084. var switchData = {
  1085. "scheduleorder": filterData.scheduleorder,
  1086. "idx": filterData.idx,
  1087. "sum": filterData.sum
  1088. };
  1089. return dataService.customPOST(switchData, 'fetchDataList/scheduleorder', {});
  1090. }
  1091. };
  1092. }]);
  1093. app.factory('SysinfoRestangular', function (Restangular) {
  1094. return Restangular.withConfig(function (RestangularConfigurer) {
  1095. RestangularConfigurer.setBaseUrl(serverIp + '/sysinfo/');
  1096. });
  1097. });
  1098. app.factory('api_sysinfo', ['SysinfoRestangular', function (SysinfoRestangular) {
  1099. var dataService = SysinfoRestangular.all("data");
  1100. return {
  1101. fetchDataList: function (model, data) {
  1102. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  1103. },
  1104. addData: function (model, data) {
  1105. return dataService.customPOST(data, 'addData/' + model, {});
  1106. },
  1107. getSerialnumber: function (type, model) {
  1108. return dataService.customGET('getSerialnumber/' + type + '/' + model);
  1109. }
  1110. };
  1111. }]);
  1112. app.factory('ConfigureRestangular', function (Restangular) {
  1113. return Restangular.withConfig(function (RestangularConfigurer) {
  1114. RestangularConfigurer.setBaseUrl(serverIp);
  1115. });
  1116. });
  1117. app.factory('api_configure_form', ['ConfigureRestangular', function (ConfigureRestangular) {
  1118. var formService = ConfigureRestangular.all("form");
  1119. // var formService = ConfigureRestangular.all("bpm/data");
  1120. return {
  1121. renderForm: function (formKey, userId, processInstanceId, id) {
  1122. if (processInstanceId) {
  1123. return formService.customGET('renderForm/' + formKey + "/" + processInstanceId + "/" + userId + "/" + id);
  1124. } else {
  1125. var ids = 0
  1126. return formService.customGET('renderForm/' + formKey + "/000000/" + userId + "/" + ids);
  1127. }
  1128. },
  1129. renderFormNoId: function (formKey, userId, processInstanceId) {
  1130. return formService.customGET('renderForm/' + formKey + "/" + processInstanceId + "/" + userId);
  1131. },
  1132. renderList: function (formKey) {
  1133. return formService.customGET('renderList/' + formKey);
  1134. },
  1135. renderTabForm: function (classify) {
  1136. return formService.customGET('renderTabForm/' + classify);
  1137. }
  1138. };
  1139. }]);
  1140. // app.factory('ConfigureRestangular', function(Restangular) {
  1141. // return Restangular.withConfig(function(RestangularConfigurer) {
  1142. // RestangularConfigurer.setBaseUrl(serverIp + '/config/');
  1143. // });
  1144. // });
  1145. app.factory('api_configure_data', ['ConfigureRestangular', function (ConfigureRestangular) {
  1146. var dataService = ConfigureRestangular.all("data");
  1147. return {
  1148. fetchDataList: function (model, data) {
  1149. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  1150. },
  1151. linkConfigure: function (model, data) {
  1152. return dataService.customPOST(data, 'linkConfigure/' + model, {});
  1153. },
  1154. fetchDataById: function (model, id) {
  1155. return dataService.customGET('fetchData/' + id + '/' + model);
  1156. },
  1157. fetchData: function (model, data) {
  1158. return dataService.customPOST(data, 'fetchData/' + model, {});
  1159. },
  1160. addData: function (model, data) {
  1161. return dataService.customPOST(data, 'addData/' + model, {});
  1162. },
  1163. rmvData: function (model, data) {
  1164. return dataService.customPOST(data, 'rmvData/' + model, {});
  1165. },
  1166. updData: function (model, data) {
  1167. return dataService.customPOST(data, 'updData/' + model, {});
  1168. },
  1169. downModels: function (model, data) {
  1170. return dataService.one(model);
  1171. },
  1172. };
  1173. }]);
  1174. //知识库新接口--jry
  1175. app.factory('ZSKXJKJRY', function (Restangular) {
  1176. return Restangular.withConfig(function (RestangularConfigurer) {
  1177. RestangularConfigurer.setBaseUrl(serverIp + '/solution');
  1178. });
  1179. });
  1180. app.factory('api_zsk', ['ZSKXJKJRY', function (ZSKXJKJRY) {
  1181. //http://127.0.0.1:9004/services/ftpFile/monitor/bankTip/
  1182. var dataList = ZSKXJKJRY.all("fetchDataList");
  1183. var quote = ZSKXJKJRY.all('solutionQuote')
  1184. return {
  1185. jry_get_list: function (data, key) {
  1186. return dataList.customPOST(data, key, {});
  1187. },
  1188. // 知识库分类模糊搜索(暂无,哈哈)
  1189. searchSolutionType: function (data, key) {
  1190. return dataList.customPOST(key, data, {});
  1191. },
  1192. jry_form_getType: function (data, key) {
  1193. return dataList.customPOST({
  1194. "idx": 0,
  1195. "sum": 10000
  1196. }, "solutionType", {});
  1197. },
  1198. solutionData: function (data, key) {
  1199. return dataList.customPOST(data, key, {});
  1200. },
  1201. solutionQuote: function (id) {
  1202. return quote.customGET(id)
  1203. }
  1204. };
  1205. }]);
  1206. app.factory('baseUrl', function (Restangular) {
  1207. return Restangular.withConfig(function (RestangularConfigurer) {
  1208. RestangularConfigurer.setBaseUrl(serverIp + '/');
  1209. });
  1210. });
  1211. app.factory('up_down_file', ['baseUrl', function (baseUrl) {
  1212. var upDownFile = baseUrl.all("");
  1213. return {
  1214. //附件上传新接口
  1215. listAttachment: function (upUrl, bindType, bindId) {
  1216. return upDownFile.customGET(upUrl + '/' + bindType + '/' + bindId);
  1217. },
  1218. listAttachments: function (upUrl, bindType, bindId) {
  1219. return upDownFile.customGET(upUrl + '/' + bindType + '/' + bindId);
  1220. },
  1221. saveAttachments: function (upUrl, bindType, bindId) {
  1222. return upDownFile.one(upUrl + '/' + bindType + '/' + bindId);
  1223. },
  1224. downloadAttachment: function (upUrl, token) {
  1225. return upDownFile.one(upUrl + '/' + token);
  1226. },
  1227. removeAttachment: function (upUrl, token) {
  1228. return upDownFile.one(upUrl + '/' + token);
  1229. }
  1230. };
  1231. }]);
  1232. app.factory('SolutionRestangular', function (Restangular) {
  1233. return Restangular.withConfig(function (RestangularConfigurer) {
  1234. //RestangularConfigurer.setBaseUrl('http://168.166.203.41:9000/services');
  1235. RestangularConfigurer.setBaseUrl(serverIp + '/solution');
  1236. });
  1237. });
  1238. //知识库附件上传--jry
  1239. app.factory('Jry_SolutionRestangular', function (Restangular) {
  1240. return Restangular.withConfig(function (RestangularConfigurer) {
  1241. //RestangularConfigurer.setBaseUrl('http://168.166.203.41:9000/services');
  1242. RestangularConfigurer.setBaseUrl(serverIp + '/common');
  1243. });
  1244. });
  1245. app.factory('api_solution', ['SolutionRestangular', 'Jry_SolutionRestangular', function (SolutionRestangular, Jry_SolutionRestangular) {
  1246. var solutionService = SolutionRestangular.all("solution");
  1247. var jry_bj = SolutionRestangular.all("updData");
  1248. var jry_rm = SolutionRestangular.all("rmvData");
  1249. var jry_getLSJL = SolutionRestangular.all("fetchDataList");
  1250. var jry_sj = SolutionRestangular.all("getVisionNumber");
  1251. var jry_sjup = SolutionRestangular.all("");
  1252. var jry_FJuploda = Jry_SolutionRestangular.all("common");
  1253. var jry_solutionService = SolutionRestangular.all("addData");
  1254. var data = SolutionRestangular.all("solutionData");
  1255. var history = SolutionRestangular.all("solutionHistory");
  1256. var review = SolutionRestangular.all("solution_review");
  1257. var typeservice = SolutionRestangular.all("solutionType");
  1258. var groupservice = SolutionRestangular.all("solutionGroup");
  1259. return {
  1260. findSolutionByKeys: function (data) {
  1261. var key = data.key,
  1262. status = data.status || 0,
  1263. pageIndex = data.pageIndex || 0,
  1264. pageSum = data.pageSum,
  1265. treeIds = data.treeIds,
  1266. userId = data.userId;
  1267. if (angular.isUndefined(treeIds)) {
  1268. return solutionService.customGET('findSolutionByKeys/' + key + '/' + status + '/' + pageIndex + '/' + pageSum + '/' + userId);
  1269. } else {
  1270. return solutionService.customGET('findSolutionByKeys/' + key + '/' + status + '/' + pageIndex + '/' + pageSum + '/' + treeIds + '/' + userId);
  1271. }
  1272. },
  1273. // searcher: function(data){
  1274. // var queryBuilder=data.key, indexname=data.treeIds, type=data.userId;
  1275. // return searchservice.customGET('searcher/' + queryBuilder + '/' + indexname + '/' + type );
  1276. // },
  1277. addSolution: function () {
  1278. return solutionService.one('add');
  1279. },
  1280. addFile: function (data) {
  1281. return solutionService.customPOST(data, 'addSolution', {});
  1282. },
  1283. jry_addFile: function (data) {
  1284. return jry_solutionService.customPOST(data, 'solution', {});
  1285. },
  1286. addData: function (model, data) {
  1287. return jry_solutionService.customPOST(data, model, {});
  1288. },
  1289. addModel: function (type, data) {
  1290. return solutionService.customPOST(data, 'addModel/' + type, {});
  1291. },
  1292. updModel: function (type, data) {
  1293. return solutionService.customPOST(data, 'updModel/' + type, {});
  1294. },
  1295. rmModels: function (id, data) {
  1296. return solutionService.customPOST(data, 'rmModels/' + id, {});
  1297. },
  1298. update: function () {
  1299. return solutionService.one('update');
  1300. },
  1301. upload: function () {
  1302. return solutionService.one('upload');
  1303. },
  1304. jry_upload: function (LCid) {
  1305. return jry_FJuploda.one('uploadAttachment/solution/' + LCid);
  1306. },
  1307. jry_upload1: function (LCid) {
  1308. return jry_FJuploda.one('uploadAttachment/knowledge/' + LCid);
  1309. },
  1310. uploadResponseUri: function () {
  1311. return solutionService.one('/');
  1312. },
  1313. addNotFile: function (data) {
  1314. return solutionService.customPOST(data, 'addNotFile', {});
  1315. },
  1316. // export: function(data) {
  1317. // return solutionService.customGET(data, 'export', {});
  1318. // },
  1319. export: function (data) {
  1320. return solutionService.one('export');
  1321. },
  1322. updateNotFile: function (data) {
  1323. return solutionService.customPOST(data, 'updateNotFile', {});
  1324. },
  1325. updateSolution: function (data) {
  1326. return solutionService.customPOST(data, 'updateSolution', {});
  1327. },
  1328. jry_updateSolution: function (data) {
  1329. return jry_bj.customPOST(data, 'solution', {});
  1330. },
  1331. updData: function (model, data) {
  1332. return jry_bj.customPOST(data, model, {});
  1333. },
  1334. rmvData: function (model, data) {
  1335. return jry_rm.customPOST(data, model, {});
  1336. },
  1337. jry_leveSolution: function (data) {
  1338. return jry_sjup.customPOST(data, 'upgrade', {});
  1339. },
  1340. jry_leveVision: function (id) {
  1341. return jry_sj.customGET(id);
  1342. },
  1343. jry_getHistory: function (data) {
  1344. return jry_getLSJL.customPOST(data, 'solution', {});
  1345. },
  1346. wt_type: function (data) {
  1347. return jry_getLSJL.customPOST(data, 'solutionType', {});
  1348. },
  1349. searchSolutionByKey: function (key, id) {
  1350. return solutionService.customGET('searchSolutionByKey/' + key + '/' + id);
  1351. },
  1352. findSolutionById: function (id) {
  1353. return solutionService.customGET('check/' + id);
  1354. },
  1355. findSolutions: function (id) {
  1356. return solutionService.customGET('check2/' + id);
  1357. },
  1358. jry_fetchDataList: function (model, data) {
  1359. return jry_sjup.customPOST(data, 'fetchDataList/' + model, {});
  1360. },
  1361. fetchDataList: function (model, data) {
  1362. return solutionService.customPOST(data, 'fetchDataList/' + model, {});
  1363. },
  1364. findSolutionDataByDateById: function (ndate, sid) {
  1365. return data.customGET('findSolutionDataByDateById/' + ndate + '/' + sid);
  1366. },
  1367. findSolutionTypeActions: function (userId) {
  1368. return typeservice.customGET('findSolutionTypeActions/' + userId);
  1369. },
  1370. findSolutionTypesUser: function (data) {
  1371. return typeservice.customPOST(data, 'findSolutionTypesUser', {});
  1372. },
  1373. addTypeUserAll: function (data) {
  1374. return typeservice.customPOST(data, 'addTypeUserAll', {});
  1375. },
  1376. hotRanking: function (num) {
  1377. return solutionService.customGET('hotRanking/' + num);
  1378. },
  1379. scoreRanking: function (num) {
  1380. return solutionService.customGET('scoreRanking/' + num);
  1381. },
  1382. fetchBBSSolutions: function (pageIndex, pageSum, sequence, userId) {
  1383. return solutionService.customGET('communicationSolutions/' + pageIndex + '/' + pageSum + '/' + sequence + '/' + userId);
  1384. },
  1385. queryBBSSolutions: function (pageIndex, pageSum, sequence, userId, key) {
  1386. return solutionService.customGET('communicationSolutions/' + pageIndex + '/' + pageSum + '/' + sequence + '/' + userId + '/' + key);
  1387. },
  1388. updateSolutionStatus: function (data) {
  1389. return solutionService.customPOST(data, 'updateSolutionStatus', {});
  1390. },
  1391. getSolutionNumber: function () {
  1392. return solutionService.customGET('getSolutionNumber');
  1393. },
  1394. addSolutionType: function (data) {
  1395. return typeservice.customPOST(data, 'add', {});
  1396. },
  1397. updateSolutionType: function (data) {
  1398. return typeservice.customPOST(data, 'update', {});
  1399. },
  1400. removeSolutionType: function (id) {
  1401. return typeservice.customGET('delete/' + id);
  1402. },
  1403. getSolutionType: function (id) {
  1404. return typeservice.customGET('' + id);
  1405. },
  1406. getTree: function (typeId, groupId, flag) {
  1407. return typeservice.customGET('getTree/' + typeId + '/' + groupId + '/' + flag);
  1408. },
  1409. checkCommentScoreByUserIds: function (userId, id) {
  1410. return review.customGET('findCommentScore/' + userId + '/' + id);
  1411. },
  1412. addSolutionReview: function (data) {
  1413. return solutionService.customPOST(data, 'addScore', {});
  1414. },
  1415. findSolutionReviewById: function (userid, id, pageIndex, pageSum) {
  1416. return solutionService.customGET('findSolutionReviewByType/' + userid + '/' + id + '/' + pageIndex + '/' + pageSum);
  1417. },
  1418. saveAllUserAuth: function (solutionId, flag) {
  1419. return solutionService.customGET('saveAllUserTrees/' + solutionId + '/' + flag);
  1420. },
  1421. updatermvSolutionType: function (typeId, groupId, userIds, flag) {
  1422. return typeservice.customGET('delOrUpdateTrees/' + typeId + '/' + groupId + '/' + userIds + '/' + flag);
  1423. },
  1424. findSolutionGroup: function (id) {
  1425. return groupservice.customGET('findSolutionGroup/' + id);
  1426. },
  1427. saveSolutionGroup: function (id, data) {
  1428. return groupservice.customPOST(data, 'saveSolutionGroup/' + id);
  1429. },
  1430. // getSolutionDowpath: function(id){
  1431. // return solutionService.one('download/'+id);
  1432. // }
  1433. getSolutionDowpath: function (attachmentId) {
  1434. return solutionService.one('download/' + attachmentId + '/file');
  1435. }
  1436. // getSolutionDowpath: function(attachmentId){
  1437. // return solutionService.customGET('download/' + attachmentId);
  1438. // }
  1439. };
  1440. }]);
  1441. // 业务系统
  1442. app.factory('CMDBRestangular2', function (Restangular) {
  1443. return Restangular.withConfig(function (RestangularConfigurer) {
  1444. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb');
  1445. });
  1446. });
  1447. // 业务系统
  1448. app.factory('api_cmdb2', ['CMDBRestangular2', function (CMDBRestangular) {
  1449. var ywxtService = CMDBRestangular.all("operationSystem");
  1450. var ywxtService1 = CMDBRestangular.all("");
  1451. return {
  1452. // 获取绑定到事件上的耗材
  1453. getHc:function(sourceId){
  1454. return ywxtService1.customPOST({
  1455. data: { type: 2, source: "1627", sourceId: sourceId },
  1456. }, 'storeList');
  1457. },
  1458. // 导入模板
  1459. importDataTpl: function (type, data) {
  1460. return ywxtService1.one(type, data, {});
  1461. },
  1462. // 列表数据
  1463. fetchDataList: function (pdKey, data) {
  1464. return ywxtService.customPOST(data, 'fetchDataList/' + pdKey, {})
  1465. },
  1466. // 列表数据
  1467. fetchDataList1: function (pdKey, data) {
  1468. return ywxtService1.customPOST(data, 'fetchDataList/' + pdKey, {})
  1469. },
  1470. // 管理单位
  1471. management_unit: function () {
  1472. return ywxtService.customGET('queryManagementUnit', {});
  1473. },
  1474. // 新增
  1475. add_preservation: function (til, data) {
  1476. return ywxtService.customPOST(data, 'addModel/' + til, {})
  1477. },
  1478. // 新增
  1479. add_preservation1: function (til, data) {
  1480. return ywxtService1.customPOST(data, 'addData/' + til, {})
  1481. },
  1482. // 删除
  1483. remov: function (til, data) {
  1484. return ywxtService.customPOST(data, 'rmModels/' + til, {})
  1485. },
  1486. // 删除
  1487. remov1: function (til, data) {
  1488. return ywxtService1.customPOST(data, 'rmModels/' + til, {})
  1489. },
  1490. // 导出数据
  1491. exportData: function (type, data) {
  1492. return ywxtService.one(type, data, {});
  1493. },
  1494. // 导出数据
  1495. exportData1: function (type, data) {
  1496. return ywxtService1.one(type, data, {});
  1497. },
  1498. // 编辑
  1499. edit_preservation: function (til, data) {
  1500. return ywxtService.customPOST(data, 'updModel/' + til, {})
  1501. },
  1502. // 编辑
  1503. edit_preservation1: function (til, data) {
  1504. return ywxtService1.customPOST(data, 'updData/' + til, {})
  1505. },
  1506. // 修改管理单位
  1507. upd_preservation: function (til, data) {
  1508. return ywxtService1.customPOST(data, 'updData/' + til, {})
  1509. },
  1510. // 删除管理单位
  1511. del_preservation: function (til, data) {
  1512. return ywxtService.customPOST(data, 'rmModels/' + til, {})
  1513. },
  1514. }
  1515. }]);
  1516. // 耗材
  1517. app.factory('CMDBRestangular3', function (Restangular) {
  1518. return Restangular.withConfig(function (RestangularConfigurer) {
  1519. RestangularConfigurer.setBaseUrl(serverIp + '/bpm');
  1520. });
  1521. });
  1522. // 耗材
  1523. app.factory('api_cmdb3', ['CMDBRestangular3', function (CMDBRestangular) {
  1524. var hcService = CMDBRestangular.all("data");
  1525. return {
  1526. // 列表数据
  1527. fetchDataList: function (pdKey, data) {
  1528. return hcService.customPOST(data, 'fetchDataList/' + pdKey, {})
  1529. },
  1530. //编辑保存
  1531. preservation: function (pdKey, data) {
  1532. return hcService.customPOST(data, 'updData/' + pdKey, {})
  1533. },
  1534. //新增
  1535. addData: function (pdKey, data) {
  1536. return hcService.customPOST(data, 'addData/' + pdKey, {})
  1537. },
  1538. // 导出数据
  1539. exportData: function (type, data) {
  1540. return hcService.one(type, data, {});
  1541. },
  1542. // 关联流程
  1543. relation: function (pdKey, data) {
  1544. return hcService.customPOST(data, 'getListBySign/' + pdKey, {})
  1545. }
  1546. }
  1547. }]);
  1548. // 耗材查询分类
  1549. app.factory('CMDBRestangular4', function (Restangular) {
  1550. return Restangular.withConfig(function (RestangularConfigurer) {
  1551. RestangularConfigurer.setBaseUrl(serverIp + '/common');
  1552. });
  1553. })
  1554. // 耗材查询分类
  1555. app.factory('api_cmdb4', ['CMDBRestangular4', function (CMDBRestangular) {
  1556. var hcService = CMDBRestangular.all("common");
  1557. return {
  1558. // 耗材查询分类
  1559. fetchDataList: function (data) {
  1560. return hcService.customPOST(data, 'getDictionary', {})
  1561. },
  1562. // 耗材分类新增
  1563. addDictionary: function (data) {
  1564. return hcService.customPOST(data, 'addDictionary', {})
  1565. },
  1566. // 耗材分类删除修改
  1567. upDictionary: function (data) {
  1568. return hcService.customPOST(data, 'upDictionary', {})
  1569. },
  1570. }
  1571. }]);
  1572. app.factory('CMDBRestangular', function (Restangular) {
  1573. return Restangular.withConfig(function (RestangularConfigurer) {
  1574. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb/');
  1575. });
  1576. });
  1577. app.factory('api_cmdb', ['CMDBRestangular', function (CMDBRestangular) {
  1578. var ciService = CMDBRestangular.all("ci");
  1579. var uuidService = CMDBRestangular.all("uuid");
  1580. var edgeService = CMDBRestangular.all("edge");
  1581. var traversal = CMDBRestangular.all("traversal");
  1582. var downloadService = CMDBRestangular.all("download");
  1583. var exportService = CMDBRestangular.all("export");
  1584. var importService = CMDBRestangular.all("import");
  1585. var exportModelService = CMDBRestangular.all("exportModel");
  1586. var importDataService = CMDBRestangular.all("importData");
  1587. var exportDataService = CMDBRestangular.all("exportData");
  1588. var searchService = CMDBRestangular.all("search");
  1589. function serializeData(data) {
  1590. // If this is not an object, defer to native stringification.
  1591. if (!angular.isObject(data)) {
  1592. return ((data == null) ? "" : data.toString());
  1593. }
  1594. var buffer = [];
  1595. // Serialize each key in the object.
  1596. for (var name in data) {
  1597. if (!data.hasOwnProperty(name)) {
  1598. continue;
  1599. }
  1600. var value = data[name];
  1601. buffer.push(
  1602. encodeURIComponent(name) + "=" + encodeURIComponent((value == null) ? "" : value)
  1603. );
  1604. }
  1605. // Serialize the buffer and clean it up for transportation.
  1606. var source = buffer.join("&").replace(/%20/g, "+");
  1607. return (source);
  1608. }
  1609. return {
  1610. create: function (data) {
  1611. return ciService.customPOST(data, '', {});
  1612. },
  1613. importData: function () {
  1614. return importDataService.one('/nodes');
  1615. },
  1616. put: function (data, id) {
  1617. return ciService.customPUT(data, id, {});
  1618. },
  1619. remove: function (id) {
  1620. return ciService.customDELETE(id);
  1621. },
  1622. removeByUUId: function (uuid) {
  1623. return ciService.customDELETE('uuid/' + id, {}, {
  1624. 'Content-Type': 'application/json'
  1625. });
  1626. },
  1627. removeRefById: function (id) {
  1628. return ciService.customDELETE(id + '/ref');
  1629. },
  1630. find: function (id) {
  1631. return ciService.customGET(id);
  1632. },
  1633. searchkey: function (type, key, idx, sum) {
  1634. return searchService.customGET(type + '/' + key + '/' + idx + '/' + sum);
  1635. },
  1636. findByUUId: function (uuid) {
  1637. return ciService.customGET('?uuid=' + uuid);
  1638. },
  1639. query: function (data) {
  1640. return ciService.customGET('query', data);
  1641. },
  1642. findRefById: function (id) {
  1643. return ciService.customGET(id + '/refs');
  1644. },
  1645. finduuid: function (type, model) {
  1646. return uuidService.customGET(type + '/' + model);
  1647. },
  1648. types: function () {
  1649. return CMDBRestangular.customGET('types');
  1650. },
  1651. createRef: function (data) {
  1652. return edgeService.customPOST(data, '', {});
  1653. },
  1654. putRef: function (data, id) {
  1655. return edgeService.customPUT(data, '' + id, {});
  1656. },
  1657. removeRef: function (id) {
  1658. return edgeService.customDELETE(id, {}, {
  1659. 'Content-Type': 'application/json'
  1660. });
  1661. },
  1662. traversal: function (uuid) {
  1663. return traversal.customGET(uuid);
  1664. },
  1665. traversalRel: function (uuid, relation) {
  1666. return traversal.customGET(uuid + '/' + relation + '/' + 'none');
  1667. },
  1668. export: function (label) {
  1669. return exportService.customGET('nodes/' + label);
  1670. },
  1671. import: function () {
  1672. return importService.one('/nodes');
  1673. },
  1674. download: function (label) {
  1675. return downloadService.one('/label');
  1676. },
  1677. exportData: function (type, model) {
  1678. return exportDataService.one(model + '/' + type);
  1679. },
  1680. downModels: function (type, model) {
  1681. return exportModelService.one(model + '/' + type);
  1682. }
  1683. };
  1684. }]);
  1685. app.factory('CMDBNEWRestangular', function (Restangular) {
  1686. return Restangular.withConfig(function (RestangularConfigurer) {
  1687. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb/');
  1688. });
  1689. });
  1690. app.factory('api_cmdb_new', ['CMDBNEWRestangular', function (CMDBNEWRestangular) {
  1691. var assetService = CMDBNEWRestangular.all("asset");
  1692. var operationSystemService = CMDBNEWRestangular.all('operationSystem')
  1693. return {
  1694. checkFile: function (model) {
  1695. return assetService.one('/checkFile/' + model);
  1696. },
  1697. getApplicationId: function (type) {
  1698. return assetService.customGET('getApplicationId/' + type);
  1699. },
  1700. fetchDataList: function (model, data) {
  1701. return operationSystemService.customPOST(data, 'fetchDataList/' + model, {});
  1702. },
  1703. fetchDataList: function (model, data) {
  1704. return operationSystemService.customPOST(data, 'fetchDataList/' + model, {});
  1705. }
  1706. }
  1707. }]);
  1708. app.factory('MonitorRestangular', function (Restangular) {
  1709. return Restangular.withConfig(function (RestangularConfigurer) {
  1710. RestangularConfigurer.setBaseUrl(serverIp + ':9004/services');
  1711. });
  1712. });
  1713. app.factory('api_monitor', ['MonitorRestangular', function (MonitorRestangular) {
  1714. //http://127.0.0.1:9004/services/ftpFile/monitor/bankTip/
  1715. var process = MonitorRestangular.all("ftpFile/monitor");
  1716. return {
  1717. bankTip: function (id) {
  1718. return process.customGET('bankTip/' + id);
  1719. },
  1720. list: function () {
  1721. return process.customGET('list/1000');
  1722. },
  1723. devList: function (id) {
  1724. return process.customGET('devList/' + id);
  1725. },
  1726. cpuList: function () {
  1727. return process.customGET('cpuList/10');
  1728. },
  1729. memList: function () {
  1730. return process.customGET('memList/10');
  1731. },
  1732. storageList: function () {
  1733. return process.customGET('storageList/10');
  1734. },
  1735. transData: function () {
  1736. return process.customGET('transData/5');
  1737. },
  1738. banklist: function () {
  1739. return process.customGET('banklist');
  1740. },
  1741. app: function (id) {
  1742. return process.customGET('app/' + id);
  1743. },
  1744. beita: function (id) {
  1745. return process.customGET('beita/' + id);
  1746. },
  1747. gongji: function (id) {
  1748. return process.customGET('gongji/' + id);
  1749. }
  1750. };
  1751. }]);
  1752. /**
  1753. * 报表
  1754. */
  1755. app.factory('NxreportRestangular', function (Restangular) {
  1756. return Restangular.withConfig(function (RestangularConfigurer) {
  1757. RestangularConfigurer.setBaseUrl(serverIp);
  1758. });
  1759. });
  1760. app.factory('api_report_nx', ['NxreportRestangular', 'Restangular', function (NxreportRestangular, Restangular) {
  1761. var reportService = NxreportRestangular.all("reportPoc");
  1762. return {
  1763. fetchDataList: function (model, data) { //事件分类
  1764. return reportService.customPOST(data, 'fetchDataList/' + model, {})
  1765. },
  1766. // getPdf: function(data) { //事件分类
  1767. // return reportService.customPOST(data, 'getPdf', {})
  1768. // },
  1769. getPdf: function (model) {
  1770. // return reportService.one('getPdf', {});
  1771. return reportService.one('getPdf', model, {});
  1772. },
  1773. };
  1774. }]);
  1775. // app.factory('NxreportRestangular', function(Restangular) {
  1776. // return Restangular.withConfig(function(RestangularConfigurer) {
  1777. // RestangularConfigurer.setBaseUrl(serverIp);
  1778. // });
  1779. // });
  1780. // app.factory('api_report_nx', ['NxreportRestangular', function(NxreportRestangular) {
  1781. // var nxreport = NxreportRestangular.all("reportPoc");
  1782. // return {
  1783. // fetchDataList: function(data, rptId) {
  1784. // return nxreport.customPOST(data, 'fetchDataList/incidentClassify', {});
  1785. // }
  1786. // }
  1787. // }]);
  1788. app.factory('ReportRestangular', function (Restangular) {
  1789. return Restangular.withConfig(function (RestangularConfigurer) {
  1790. //RestangularConfigurer.setBaseUrl('http://127.0.0.1:9005/api/cmdb/');
  1791. RestangularConfigurer.setBaseUrl(reportIp + ':8080/saiku/rest');
  1792. // RestangularConfigurer.setBaseUrl(serverIp + ':8888/saiku/rest');
  1793. //saiku/rest/saiku/api/query/execute/
  1794. });
  1795. });
  1796. app.factory('api_report', ['ReportRestangular', 'Restangular', function (MonitorRestangular, Restangular) {
  1797. // var reportService = MonitorRestangular.all("saiku/api");
  1798. var authService = MonitorRestangular.one("saiku/session");
  1799. return {
  1800. getLicenseKey: function () {
  1801. // return Restangular.one('assets/').customGET('api/reportToken.js');
  1802. },
  1803. // auth: function(){
  1804. // return authService.customPOST('username=admin&password=admin&language=zh'
  1805. // ,'', {}, {'Content-Type': 'application/x-www-form-urlencoded'});
  1806. // },
  1807. // session: function(){
  1808. // return authService.customGET('');
  1809. // },
  1810. list: function () {
  1811. return reportService.customGET('repository?type=saiku');
  1812. /**
  1813. /saiku/api/repository
  1814. path: /homes/home:admin/itsm_reports
  1815. */
  1816. },
  1817. getMdx: function (path, uuid) {
  1818. var rdata = 'file=' + path + '&formatter=flattened&language=zh';
  1819. return reportService.customPOST(rdata, 'query/' + uuid, {}, {
  1820. 'Content-Type': 'application/x-www-form-urlencoded'
  1821. });
  1822. },
  1823. execute: function (data) {
  1824. return reportService.customPOST(data, 'query/execute', {}, {
  1825. 'Accept': 'application/json, text/javascript, */*'
  1826. });
  1827. },
  1828. exportData: function (reportView, uuid, reportfileName) {
  1829. return reportService.one('query/rest/export/xls/?exportname=' + reportfileName + 'xls');
  1830. }
  1831. };
  1832. }]);
  1833. // 首页仪表盘
  1834. app.factory('ReportnewRestangular', function (Restangular) {
  1835. return Restangular.withConfig(function (RestangularConfigurer) {
  1836. RestangularConfigurer.setBaseUrl(serverIp + '/report');
  1837. });
  1838. })
  1839. // 首页仪表盘
  1840. app.factory('api_newreport', ['ReportnewRestangular', function (ReportnewRestangular) {
  1841. var hcService = ReportnewRestangular.all("data");
  1842. return {
  1843. // 事件解决率
  1844. fetchDataList: function (model, data) {
  1845. return hcService.customPOST(data, 'fetchDataList/' + model, {})
  1846. },
  1847. // 首页仪表盘
  1848. addDictionary: function (data) {
  1849. return hcService.customPOST(data, 'addDictionary', {})
  1850. },
  1851. // 首页仪表盘
  1852. upDictionary: function (data) {
  1853. return hcService.customPOST(data, 'upDictionary', {})
  1854. },
  1855. }
  1856. }]);
  1857. // 月度任务导出
  1858. app.factory('TaskRestangular', function (Restangular) {
  1859. return Restangular.withConfig(function (RestangularConfigurer) {
  1860. // RestangularConfigurer.setBaseUrl("http://168.166.3.41"+':9008/api/');
  1861. RestangularConfigurer.setBaseUrl(serverIp + '/task');
  1862. });
  1863. });
  1864. app.factory('api_task_export', ['TaskRestangular', function (TaskRestangular) {
  1865. var dataService = TaskRestangular.all("data");
  1866. return {
  1867. taskExport: function (model, dataId) {
  1868. return dataService.one(model + '/' + dataId);
  1869. },
  1870. // 任务清单
  1871. yearListSee: function (year, month) {
  1872. return dataService.customGET('previewTask/' + year + '/' + month);
  1873. },
  1874. // 任务清单导出
  1875. yearListExport: function (year, month) {
  1876. return dataService.one('exportTask' + '/' + year + '/' + month);
  1877. }
  1878. };
  1879. }]);
  1880. // 文档管理接口
  1881. app.factory('DocRestangular', function (Restangular) {
  1882. return Restangular.withConfig(function (RestangularConfigurer) {
  1883. // RestangularConfigurer.setBaseUrl("http://168.166.3.41"+':9008/api/');
  1884. RestangularConfigurer.setBaseUrl(serverIp + '/doc');
  1885. });
  1886. });
  1887. app.factory('api_doc_data', ['DocRestangular', function (DocRestangular) {
  1888. var dataService = DocRestangular.all("data");
  1889. return {
  1890. // 删除历史版本
  1891. delileVersion: function (data) {
  1892. return dataService.customPOST(data, 'delileVersion', {});
  1893. },
  1894. // 引入文件
  1895. insertIndexFile: function (data) {
  1896. return dataService.customPOST(data, 'insertIndexFile', {});
  1897. },
  1898. // 搜索统一接口
  1899. selectContent: function (data) {
  1900. return dataService.customPOST(data, 'selectContent', {});
  1901. },
  1902. // 文件历史读取
  1903. fileVersion: function (data) {
  1904. return dataService.customPOST(data, 'fileVersion', {});
  1905. },
  1906. // 文件下载
  1907. download: function (data) {
  1908. return dataService.one('downloadFile')
  1909. },
  1910. // 文件更新
  1911. newDoc: function (fileId) {
  1912. return dataService.one('updateFile')
  1913. },
  1914. // 文件导入
  1915. uploadDoc: function (docId) {
  1916. return dataService.one('importFile', docId)
  1917. },
  1918. // 文件导入附带上传者id
  1919. jry_uploadDoc: function (docId, userId) {
  1920. return dataService.one('importFile' + '/' + docId + '/' + userId)
  1921. },
  1922. //文件更换目录
  1923. jry_filesChange: function (id, data) {
  1924. return dataService.customPOST(data, 'refolder/' + id, {});
  1925. },
  1926. // 索引更换目录
  1927. jry_indexesChange: function (oldId, newId, data) {
  1928. return dataService.customPOST(data, 'refolder/' + oldId + '/' + newId, {});
  1929. },
  1930. fetchDataList: function (model, data) {
  1931. return dataService.customPOST(data, 'fetchDataList/' + model, {});
  1932. },
  1933. data: function (model, data) {
  1934. return dataService.customPOST(data, model, {});
  1935. },
  1936. };
  1937. }]);
  1938. // 消息通知管理
  1939. app.factory('notificationApi', function (Restangular) {
  1940. return Restangular.withConfig(function (RestangularConfigurer) {
  1941. RestangularConfigurer.setBaseUrl(serverIp + '/bpm');
  1942. });
  1943. });
  1944. app.factory('api_notification_data', ['notificationApi', function (notificationApi) {
  1945. var dataService = notificationApi.all("data");
  1946. return {
  1947. // 获取消息通知列表
  1948. fetchDataList: function (data) {
  1949. return dataService.customPOST(data, 'fetchDataList/messageManager');
  1950. },
  1951. // 修改消息通知
  1952. updData: function (data) {
  1953. return dataService.customPOST(data, 'updData/messageManager');
  1954. }
  1955. };
  1956. }]);
  1957. // 事件报表-seimin
  1958. app.factory('eventFormApi', function (Restangular) {
  1959. return Restangular.withConfig(function (RestangularConfigurer) {
  1960. RestangularConfigurer.setBaseUrl(serverIp + '/report');
  1961. });
  1962. });
  1963. app.factory('api_event_form', ['eventFormApi', function (eventFormApi) {
  1964. var dataService = eventFormApi.all("data");
  1965. return {
  1966. // 事件总数
  1967. fetchSjzsList: function (data) {
  1968. return dataService.customPOST(data, 'mdv2_incident_repot_sum');
  1969. },
  1970. // 事件类型
  1971. fetchSjlxList: function (data) {
  1972. return dataService.customPOST(data, 'mdv2_incident_repot_type');
  1973. },
  1974. // 处理人/组
  1975. fetchClrzList: function (data) {
  1976. return dataService.customPOST(data, 'mdv2_incident_repot_handle');
  1977. },
  1978. // 三方公司
  1979. fetchSfgsList: function (data) {
  1980. return dataService.customPOST(data, 'mdv2_incident_repot_company');
  1981. },
  1982. // 区域地点
  1983. fetchQyddList: function (data) {
  1984. return dataService.customPOST(data, 'mdv2_incident_repot_area_place');
  1985. },
  1986. // 事件来源
  1987. fetchSjlyList: function (data) {
  1988. return dataService.customPOST(data, 'mdv2_incident_repot_source');
  1989. },
  1990. // 查询事件总数(单个页面只有事件数量)
  1991. getSjNum: function (data) {
  1992. return dataService.customPOST(data, 'mdv2_incident_sum');
  1993. },
  1994. // 综合统计
  1995. fetchZhtjList: function (data) {
  1996. return dataService.customPOST(data, 'mdv2_service_repot_all');
  1997. },
  1998. // 电话统计
  1999. fetchDhtjList: function (data) {
  2000. return dataService.customPOST(data, 'mdv2_service_repot_phone');
  2001. },
  2002. // 微信/WEB统计
  2003. fetchWebList: function (data) {
  2004. return dataService.customPOST(data, 'mdv2_service_repot_wechat_web');
  2005. },
  2006. // 电话留言统计
  2007. fetchDhlytjList: function (data) {
  2008. return dataService.customPOST(data, 'mdv2_service_repot_msg');
  2009. }
  2010. };
  2011. }]);
  2012. // 服务台分析-seimin
  2013. app.factory('deckReportApi', function (Restangular) {
  2014. return Restangular.withConfig(function (RestangularConfigurer) {
  2015. RestangularConfigurer.setBaseUrl(serverIp + '/report');
  2016. });
  2017. });
  2018. app.factory('api_deck_report', ['deckReportApi', function (deckReportApi) {
  2019. var dataService = deckReportApi.all("data");
  2020. return {
  2021. // 来电总数
  2022. fetchLdzsNumList: function (data) {
  2023. return dataService.customPOST(data, 'service_phone_total');
  2024. },
  2025. };
  2026. }]);
  2027. // 登录后判断版本-seimin
  2028. app.factory('isCategoryApi', function (Restangular) {
  2029. return Restangular.withConfig(function (RestangularConfigurer) {
  2030. RestangularConfigurer.setBaseUrl(serverIp + '/sysinfo');
  2031. });
  2032. });
  2033. app.factory('api_is_category', ['isCategoryApi', function (isCategoryApi) {
  2034. var dataService = isCategoryApi.all("data");
  2035. return {
  2036. //判断处理人、处理科室seimin
  2037. isCategory: function (data) {
  2038. return dataService.customPOST(data, 'fetchDataList/systemConfiguration');
  2039. }
  2040. };
  2041. }]);
  2042. // 搜索科室列表-seimin
  2043. app.factory('searchKs', function (Restangular) {
  2044. return Restangular.withConfig(function (RestangularConfigurer) {
  2045. RestangularConfigurer.setBaseUrl(serverIp + '/user');
  2046. });
  2047. });
  2048. app.factory('api_search_ks', ['searchKs', function (searchKs) {
  2049. var dataService = searchKs.all("data");
  2050. return {
  2051. //获取科室列表
  2052. getKsList: function (data) {
  2053. return dataService.customPOST(data, 'fetchDataList/department');
  2054. }
  2055. };
  2056. }]);
  2057. // 搜索故障地点seimin
  2058. app.factory('searchArea', function (Restangular) {
  2059. return Restangular.withConfig(function (RestangularConfigurer) {
  2060. RestangularConfigurer.setBaseUrl(serverIp + '/apply');
  2061. });
  2062. });
  2063. app.factory('api_search_area', ['searchArea', function (searchArea) {
  2064. var dataService = searchArea.all("bpm");
  2065. return {
  2066. //获取故障地点
  2067. getAreaList: function (data) {
  2068. return dataService.customPOST(data, 'searchFaultLocation');
  2069. }
  2070. };
  2071. }]);
  2072. // 微信配置查询接口seimin
  2073. app.factory('wechatConfig', function (Restangular) {
  2074. return Restangular.withConfig(function (RestangularConfigurer) {
  2075. RestangularConfigurer.setBaseUrl(serverIp + '/wechat');
  2076. });
  2077. });
  2078. app.factory('api_wechat_operate', ['wechatConfig', function (wechatConfig) {
  2079. var dataService = wechatConfig.all("data");
  2080. return {
  2081. //获取微信配置信息
  2082. getWechatList: function (data) {
  2083. return dataService.customPOST(data, 'fetchDataList/wechatConfig');
  2084. },
  2085. //修改微信配置
  2086. postWxList: function (data) {
  2087. return dataService.customPOST(data, 'addData/wechatConfig');
  2088. }
  2089. };
  2090. }]);
  2091. // 微信配置获取角色seimin
  2092. app.factory('wxRole', function (Restangular) {
  2093. return Restangular.withConfig(function (RestangularConfigurer) {
  2094. RestangularConfigurer.setBaseUrl(serverIp + '/user');
  2095. });
  2096. });
  2097. app.factory('api_wx_role', ['wxRole', function (wxRole) {
  2098. var dataService = wxRole.all("data");
  2099. return {
  2100. //获取微信配置获取角色
  2101. getWxRole: function (data) {
  2102. return dataService.customPOST(data, 'fetchDataList/role');
  2103. }
  2104. };
  2105. }]);
  2106. // CMDB打印
  2107. app.factory('cmdbPrit', function (Restangular) {
  2108. return Restangular.withConfig(function (RestangularConfigurer) {
  2109. RestangularConfigurer.setBaseUrl(serverIp + '/cmdb');
  2110. });
  2111. });
  2112. app.factory('api_cmdb_print', ['cmdbPrit', function (cmdbPrit) {
  2113. var dataService = cmdbPrit.all("ci");
  2114. return {
  2115. //CMDB打印
  2116. getCmdbPrit: function (data) {
  2117. return dataService.customGET('qrcode/' + data);
  2118. }
  2119. };
  2120. }]);