main.js 78 KB

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