main.js 86 KB

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