main.js 85 KB

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