main.js 82 KB

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