main.js 86 KB

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