main.js 82 KB

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