main.js 86 KB

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