main.js 86 KB

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