main.js 83 KB

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