info.js
28.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
//公共组件
//服务接口
angular.module("xn/template/header.html",[]).run(["$templateCache", function($templateCache) {
"use strict";
$templateCache.put("headerTopInfoCenter/tpl.html",
"<div class=\'layout-info-layout\'>" +
" <div class=\'info-item\'>" +
" <a class=\'item\'href='{{xnConfig.myUrl}}index.htm' target='_self' title='{{i18n.new.home}}'><i class=\'item-icon icon icon-info-home\'></i></a>" +
/* " <div class=\'info-popup popup-home\' >" +
" <div class=\'popup-layout\'>首页 </div>" +
" </div>" +*/
" </div>" +
" <div class=\'info-item\'>" +
" <a class=\'item\'href='{{xnConfig.serviceUrl}}feedback/create.htm' target='_self' title='{{i18n.new.service}}'><i class=\'item-icon icon icon-kefu\'></i></a>" +
" </div>" +
" <div class=\'info-item\'>" +
" <a class=\'item\' href='{{xnConfig.myUrl}}application.htm' title='{{i18n.new.application}}'><i class=\'item-icon icon icon-info-application\'></i></a>" +
" <div class=\'info-popup popup-application\' >" +
" <div class=\'popup-layout\'>" +
" <div class=\'popup-header\'>" +
" <span>{{i18n.new.application}}</span>" +
" <div class='application-search'>" +
" <input class='application-input' ng-model='applicationKey' placeholder='{{i18n.new.applicationPlaceholder}}'><i class='search-icon icon icon-sousuo'></i>" +
" </div>" +
" </div>" +
" <ul class=\'popup-body\' ng-if='!applicationKey'>" +
" <li class=\'popup-item\' ng-repeat=\'app in appList track by $index\' ng-if=\"$index<8\" >" +
" <a class=\'item-link \' href='{{app.url}}' target='_self'>" +
" <img class=\'link-img\' ng-src='{{xnConfig.imgUrl}}icon/application/{{app.applicationId}}.png'>" +
" <span class=\'link-name\'>{{app.applicationName}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item-no popup-item-no-app\' ng-if='appList.length==0'><div class='popup-item-no-img no-app'></div>{{i18n.new.noAppList}}<br/>{{i18n.new.noAppList2}}</li>" +
" </ul>" +
" <ul class=\'popup-body\' ng-if='applicationKey'>" +
" <li class=\'popup-item\' ng-repeat=\'app in appAllList | filter:applicationKey track by $index \' ng-if=\"$index<8\" >" +
" <a class=\'item-link \' href='{{app.url}}' target='_self'>" +
" <img class=\'link-img\' ng-src='{{xnConfig.imgUrl}}icon/application/{{app.applicationId}}.png'>" +
" <span class=\'link-name\'>{{app.applicationName}}</span>" +
" </a>" +
" </li>" +
" </ul>" +
" <div class=\'popup-footer\'>" +
" <a class=\'footer-link\' href='{{xnConfig.myUrl}}application.htm' target=\'_self\'>{{i18n.new.allApplication}}</a>" +
" </div>" +
" </div>" +
" </div>" +
" </div>" +
" <div class=\'info-item\' ng-if='showConfig.isShowMessage'>" +
" <a class=\'item\' href='{{xnConfig.myUrl}}mine/message/index.htm' target='_self' title='{{i18n.new.message}}'>" +
" <i class=\'item-icon icon icon-info-message\'></i><span class=\'tip\' title=\'{{messagesAll.length}}\' ng-show='messagesAll.length>0'>{{messagesAll.length}}</span></a>" +
" <div class=\'info-popup popup-message\' >" +
" <div class=\'popup-layout\'>" +
" <div class=\'popup-header\'>" +
" <span>{{i18n.new.message}}({{messagesAll.length}})</span>" +
" </div>" +
" <ul class=\'popup-body\'>" +
" <li class=\'popup-item\' ng-repeat='message in messages track by $index'>" +
" <a class=\'item-link \' ng-href=\"{{message.messageUrl}}\" target=\"_blank\">" +
" <span class=\'link-name\'>{{message.messageTitle}}</span>" +
" <span class=\'message-time\'>{{message.localSendTime}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item-no\' ng-if='messages.length==0'> <div class='popup-item-no-img no-messages'></div>{{i18n.new.noMessage}}</li>" +
" </ul>" +
" <div class=\'popup-footer\'>" +
" <a class=\'footer-link\' href='{{xnConfig.myUrl}}mine/message/index.htm' target=\'_self\'>{{i18n.new.allMessage}}</a>" +
" </div>" +
" </div>" +
" </div>" +
" </div>" +
" <div class=\'info-item\' ng-if='showConfig.isShowTask'>" +
" <a class=\'item\' href='{{xnConfig.myUrl}}task/futrue.htm' target='_blank' title='{{i18n.new.task}}'>" +
" <i class=\'item-icon icon icon-info-task\'></i><span class=\'tip\' title=\'{{tasksAll.length}}\' ng-show='tasksAll.length>0'>{{tasksAll.length}}</span></a>" +
" <div class=\'info-popup popup-task\' >" +
" <div class=\'popup-layout\'>" +
" <div class=\'popup-header\'>" +
" <span>{{i18n.new.task}}({{tasksAll.length}})</span>" +
" </div>" +
" <ul class=\'popup-body\'>" +
" <li class=\'popup-item\' ng-repeat='task in tasks track by $index'>" +
" <a class=\'item-link\' href='{{task.assignReason}}' target='_self' >" +
" <div class=\'item-title\'><span class=\'link-name\'>{{task.processName}}</span>" +
" <span class='status ' ng-if='false' ng-class='{\"status-maturity\":rowVersion==0,\"status-expired\":rowVersion!=0}'>马上到期</span> " +
" </div>" +
" <div class=\'link-text\'>{{task.owner.name}}{{task.assignCode }}</div>" +
" </a>" +
" </li>" +
" <li class=\'popup-item-no\' ng-if='tasks.length==0'> <div class='popup-item-no-img no-task'></div>{{i18n.new.noTask}}</li>" +
" </ul>" +
" <div class=\'popup-footer\'>" +
" <a class=\'footer-link\' href='{{xnConfig.myUrl}}task/futrue.htm' target=\'_blank\'>{{i18n.new.allTask}}</a>" +
" </div>" +
" </div>" +
" </div>" +
" </div>" +
" <div class=\'info-item\' ng-if='showConfig.isShowNote'>" +
" <a class=\'item\' title='便签'><i class=\'item-icon icon icon-info-note\'></i></a>" +
" <div class=\'info-popup popup-note\'>" +
" <div class=\'popup-layout\'>" +
" <div class=\'popup-header\'>" +
" <span>便签</span>" +
" </div>" +
" <ul class=\'popup-body\'>" +
" <li class=\'popup-item\'>" +
" <a class=\'item-link \'>" +
" <img class=\'link-img\' src=\'//pic.xiami.net/images/album/img91/826191/21001921281515826191.jpg?x-oss-process=image/resize,limit_0,m_pad,w_185,h_185\'>" +
" <span class=\'link-name\'>采购管理</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\'>" +
" <a class=\'item-link \'>" +
" <img class=\'link-img\' src=\'//pic.xiami.net/images/album/img91/826191/21001921281515826191.jpg?x-oss-process=image/resize,limit_0,m_pad,w_185,h_185\'>" +
" <span class=\'link-name\'>采购管理</span>" +
" </a>" +
" </li>" +
" </ul>" +
" <div class=\'popup-footer\'>" +
" </div>" +
" </div>" +
" </div>" +
" </div>" +
" <div class=\'info-item info-user\'>" +
" <div class=\'item\'><span class=\'user-name\'>{{user.name}}</span><span class=\'user-more\'></span>" +
" <img class=\'user-avatar\' ng-if='user.avatar' ng-src='{{user.avatar}}?x-oss-process=image/resize,m_lfit,w_24,h_24\'>" +
" <div class=\'user-avatar-default\' ng-if='!user.avatar'></div>" +
" </div>" +
" <div class=\'info-popup popup-user\'>" +
" <div class=\'popup-layout\'>" +
" <div class=\'popup-header\'>" +
" <span>{{i18n.new.personal}}</span>" +
" </div>" +
" <ul class=\'popup-body\'>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowInformation'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}profileView' target='_self'>" +
" <i class=\'link-icon icon icon-info-information\'></i><span class=\'link-name\'>{{i18n.new.information}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowTenant'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}tenant' target='_self'>" +
" <i class=\'link-icon icon icon-info-tenant\'></i><span class=\'link-name\'>{{i18n.new.tenant}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowCollection'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}mine/collection/index.htm' target='_self'>" +
" <i class=\'link-icon icon icon-info-collection\'></i><span class=\'link-name\'>{{i18n.new.collection}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowHistory'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}mine/history/index.htm' target='_self'>" +
" <i class=\'link-icon icon icon-info-history\'></i><span class=\'link-name\'>{{i18n.new.history}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowPan'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}pan/file.htm' target='_self'>" +
" <i class=\'link-icon icon icon-info-disk\'></i><span class=\'link-name\'>{{i18n.new.file}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowFile'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}mine/file/index.htm' target='_self'>" +
" <i class=\'link-icon icon icon-info-file\'></i><span class=\'link-name\'>{{i18n.new.fileCenter}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowChangePassword'>" +
" <a class=\'item-link \' href='{{xnConfig.myUrl}}auth/change.htm' target='_self' >" +
" <i class=\'link-icon icon icon-info-password\'></i><span class=\'link-name\'>{{i18n.new.password}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowDownload'>" +
" <a class=\'item-link \'>" +
" <i class=\'link-icon icon icon-info-download\'></i><span class=\'link-name\'>{{i18n.new.download}}</span>" +
" </a>" +
" </li>" +
" <li class=\'popup-item\' ng-if='showConfig.isShowStyle'>" +
" <a class=\'item-link \'>" +
" <i class=\'link-icon icon icon-info-style\'></i><span class=\'link-name\'>{{i18n.new.style}}</span>" +
" </a>" +
" </li>" +
" </ul>" +
" <div class=\'popup-footer\'>" +
" <a class=\'footer-link\' href='{{xnConfig.myUrl}}auth/logout.htm' target=\'_self\'><i class=\'link-icon icon icon-info-quit\'></i>{{i18n.new.out}}</a>" +
" </div>" +
" </div>" +
" </div>" +
" </div>" +
" <div class=\'info-item info-more\'>" +
" <div class=\'item\'><span class=\'point\'></span><span class=\'point\'></span><span class=\'point\'></span></div>" +
" <div class=\'info-popup popup-version\'>" +
" <div class=\'popup-layout\'>" +
" <div class=\'popup-header\'>" +
" <span>{{i18n.new.copyright}}</span>" +
" </div>" +
" <ul class=\'popup-body\'>" +
" <li class=\'popup-item\'>" +
" <div class=\'item-version\'>" +
" {{i18n.new.copyrightText}} <a href=\'http://www.miitbeian.gov.cn/publish/query/indexFirst.action;jsessionid=VZ-DkfA_b_iOkeNbyEccruaKVC1hb-n81Deh85fTL7lvwQT5QqkH!1316315234\'> {{i18n.new.filing}}</a>" +
" </div>" +
" </li>" +
" </ul>" +
" </div>" +
" </div>" +
" </div>" +
"</div>"
);
}]);
angular.module("xn.directive.info",["xn/template/header.html"])
.value("xnConfig", [])
.directive("layoutInfo", ["$modal","InfoService","xnConfig",function($modal,infoService,xnConfig) {
var config = [];
var defaultInfoConfig={
"isShowIndex":false, /*首页*/
"isShowTask":false, /*任务*/
"isShowMessage":false, /*消息*/
"isShowNote":false, /*消息*/
"isShowInformation":true, /*个人信息*/
"isShowTenant":true, /*承租人*/
"isShowCollection":true, /*收藏*/
"isShowHistory":true, /*历史记录*/
"isShowPan":true, /*网盘*/
"isShowFile":true, /*文件中心*/
"isShowChangePassword":true, /*修改密码*/
"isShowDownload":false, /*修改密码*/
"isShowStyle":false, /*关于*/
"isShowLogout":true /*退出*/
};
if(xnConfig){
config = angular.extend(config, xnConfig);
};
return {
restrict: "AE",
scope: {
userType:"@",
language:"@"
},
templateUrl: "headerTopInfoCenter/tpl.html",
link: function(scope,element,atter,ngModel) {
if(config){
scope.xnConfig = config
}
scope.i18n={
new:{},
cn:{
"home":"首页",
"service":"客服",
"application":"应用中心",
"allApplication":"所有应用",
"noAppList":"你还没有设置常用应用" ,
"noAppList2":"在所有应用页面可以设置哦~" ,
"applicationPlaceholder":"搜索应用",
"message":"消息",
"allMessage":"所有消息",
"noMessage":"你还没有新消息哦~",
"task":"任务",
"allTask":"所有任务",
"noTask":"你还没有新任务哦~",
"personal":"个人中心",
"information":"个人信息",
"tenant":"企业信息",
"collection":"个人收藏",
"history":"历史记录",
"fileCenter":"文件中心",
"file":"个人网盘",
"password":"修改密码",
"download":"下载中心",
"style":"设置样式",
"out":"退出登录",
"copyright":"关于版权",
"copyrightText":"犀牛网络·版权所有© 2014-2019 ",
"filing":"苏 ICP 备14044978号",
},
en:{
"home":"Home",
"application":"Application",
"allApplication":"All Application",
"noAppList":"No common applications",
"noAppList2":"Can be set on all application pages" ,
"applicationPlaceholder":"Search applications",
"message":"Message",
"allMessage":"View All",
"noMessage":"No Messages",
"task":"Task",
"allTask":"View All",
"noTask":"No Task",
"personal":"Personal",
"information":"My info",
"tenant":"Corporate",
"collection":"Collection",
"history":"History",
"fileCenter":"File center",
"file":"Personal Disk",
"password":"Reset Password",
"download":"Download center",
"style":"Set style",
"out":"Exit",
"copyright":"About copyright",
"copyrightText":"xiniu all rights reserved © 2014-2019",
"filing":"su ICP No. 14044978"
}
};
function doLanguage (language,start) {
switch (language){
//简体中文(中国)
case "ZH_CN":
// 繁体中文(台湾地区)
case "ZH_TW":
// 繁体中文(香港地区)
case "ZH_HK":
scope.i18n.new=scope.i18n.cn;
break;
// 英语(香港地区)
case "EN_HK":
// 英语(美国)
case "EN_US":
// 英语(英国)
case "EN_GB":
// 英语(全球)
case "EN_WW":
// 英语(欧洲)
case "EN_EU":
scope.i18n.new=scope.i18n.en;
break;
// // 法语(欧洲)
// case "FR_EU":
// // 德语(欧洲)
// case "DE_EU":
// // 日语(日本)
// case "JA_JP":
default:
if(start){
doLanguage(xnConfig.language);
}else {
scope.i18n.new=scope.i18n.cn;
}
break;
}
}
doLanguage(scope.language,true);
/*赋值哪些显示哪些不显示*/
if(scope.defaultShow && angular.isObject(scope.defaultShow)){
scope.showConfig=angular.extend(defaultInfoConfig, scope.defaultShow);
}else {
scope.showConfig=defaultInfoConfig;
}
if(scope.userType){
switch (scope.userType)
{ case "EMPLOYEE":
case "NONE":
scope.showConfig.isShowAddressBook=true;
scope.showConfig.isShowIndex=true;
scope.showConfig.isShowMessage=true;
scope.showConfig.isShowTask=true;
break;
case "MEMBER":
// 会员
scope.showConfig.isShowApp=false;
scope.showConfig.isShowYun=false;
scope.showConfig.isShowCustomer=false;
scope.showConfig.isShowAddressBook=false;
scope.showConfig.isShowHelp=false;
scope.showConfig.isShowIndex=false;
scope.showConfig.isShowMessage=false;
scope.showConfig.isShowTask=false;
scope.showConfig.isShowTenant=false;
scope.showConfig.isShowCollection=false;
scope.showConfig.isShowHistory=false;
scope.showConfig.isShowPan=false;
break;
case "SUPPLIER":
// 供应商
scope.showConfig.isShowApp=false;
scope.showConfig.isShowYun=false;
scope.showConfig.isShowCustomer=false;
scope.showConfig.isShowAddressBook=false;
scope.showConfig.isShowHelp=false;
scope.showConfig.isShowIndex=false;
scope.showConfig.isShowMessage=true;
scope.showConfig.isShowTask=false;
scope.showConfig.isShowTenant=false;
scope.showConfig.isShowCollection=false;
scope.showConfig.isShowHistory=false;
scope.showConfig.isShowPan=false;
break;
default:
scope.showConfig.isShowAddressBook=false;
scope.showConfig.isShowIndex=false;
scope.showConfig.isShowMessage=false;
scope.showConfig.isShowTask=false;
break;
}
}
scope.user={};
/*获取用户信息*/
infoService.getUser({}).then(function(data) {
scope.user=data.user;
});
/*获取应用列表*/
scope.getAppList=function(){
//常用应用
infoService.getCommonlyList().then(function(data) {
scope.appList = [];
scope.appAll = data.result;
if (scope.appAll != undefined) {
if (data.result.length > 8) {
for (var i = 0; i <8; i++) {
scope.appList.push(data.result[i]);
}
} else {
scope.appList = data.result;
}
}else{
scope.appList=[];
}
});
//所有应用
infoService.getCommonlyAppList().then(function(data) {
scope.appAllList = data.result;
});
};
scope.getAppList();
//获取消息列表
scope.getMessageList = function () {
infoService.getMessageList().then(function (data) {
scope.messages = [];
scope.messagesAll = data.result;
if (scope.messagesAll != undefined) {
if (data.result.length > 8) {
for (var i = 0; i < 8; i++) {
scope.messages.push(data.result[i]);
}
} else {
scope.messages = data.result;
}
}else{
scope.messagesAll=[];
}
});
};
if(scope.showConfig.isShowMessage){
scope.getMessageList();
}
/*获取任务列表*/
scope.getTaskList = function () {
infoService.getTaskList().then(function (data) {
scope.tasks = [];
scope.tasksAll = data.result;
if (scope.tasksAll != undefined) {
if (data.result.length > 4) {
for (var i = 0; i < 4; i++) {
scope.tasks.push(data.result[i]);
}
} else {
scope.tasks = data.result;
}
}else{
scope.tasksAll=[];
}
});
};
if(scope.showConfig.isShowTask){
scope.getTaskList();
}
}
};
}])
.factory("InfoService",["$http",function($http){
var service={};
//消息明细获取
service.getMessageDetail=function(request) {
/* var url="http://local.xiniunet.com/api/foundation.do";*/
var url=xnConfig.outside+"api/foundation.do";
return $http({
method : "GET",
withCredentials:true,
url : url,
params:{"method":"api.foundation.message.get","ids":[request.id]}
//data:request
});
};
//获取用户信息
service.getUser=function(data) {
var url=xnConfig.myUrl+"system/api.do";
return $http({
method : "POST",
withCredentials:true,
url : url,
data:data,
params:{"method":"api.system.user.get"}
});
};
//未读消息读取
service.getMessageList=function() {
var url=xnConfig.outside+"api/foundation.do";
return $http({
method : "POST",
withCredentials:true,
url : url,
params:{"method":"api.foundation.messages.get"}
});
};
//待办任务获取
service.getTaskList=function() {
var url=xnConfig.outside+"api/foundation.do";
return $http({
method : "POST",
withCredentials:true,
url : url,
params:{"method":"api.foundation.tasks.get"}
});
};
//获取常用应用列表
service.getCommonlyList = function () {
var url = xnConfig.outside+"system/api.do";
return $http({
method: "POST",
withCredentials:true,
url: url,
params: {"method": "api.platform.application.get.commonly"}
});
};
//获取所有应用
service.getCommonlyAppList = function () {
var url = xnConfig.outside+"system/api.do";
return $http({
method: "POST",
withCredentials:true,
url: url,
params: {"method": "api.platform.application.get.user"}
});
};
return service;
}]);