main.js 85 KB

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