main.js 85 KB

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