main.js 85 KB

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