yangjunfeng %!s(int64=5) %!d(string=před) roky
rodič
revize
41a55562ff

+ 3 - 3
WebChart/Script/Common/huayi.config.js

@@ -1,4 +1,4 @@
1
-if (huayi == undefined) {
1
+if (huayi == undefined) {
2 2
     var huayi = {};
3 3
 }
4 4
 huayi.config = {
@@ -7,8 +7,8 @@ huayi.config = {
7 7
     //callcenter_data: "http://192.168.4.18:4032/",//市县选择
8 8
 // callcenter_url: "http://12345.shangqiu.gov.cn:8819/",//生产环境
9 9
     //callcenter_url: "http://localhost:63662/"//测试环境
10
-//  socket_ip: "192.168.5.8",//ip
11
-    socket_ip: "192.168.4.3",//ip
10
+    socket_ip: "125.45.12.160",//ip
11
+    // socket_ip: "192.168.8.7",//ip
12 12
     socket_port: "8081",//端口
13 13
     menuworktime: 30000,//菜单工单数量刷新间隔
14 14
     indextime: 30000//首页报表刷新间隔

+ 60 - 0
WebChart/Script/Common/huayi.config_1.js

@@ -0,0 +1,60 @@
1
+if (huayi == undefined) {
2
+    var huayi = {};
3
+}
4
+huayi.config = {
5
+//	callcenter_url: unescape($.cookie("callcenter_url")),//生产环境
6
+//  socket_ip: $.cookie("socket_ip"),//ip
7
+//  socket_port: $.cookie("socket_port"),//端口
8
+//  menuworktime: Number($.cookie("menuworktime")),//菜单工单数量刷新间隔
9
+//  indextime: Number($.cookie("indextime")),//首页报表刷新间隔
10
+//  messageTime:Number($.cookie("messageTime")),
11
+    callcenter_url: "http://192.168.8.20:1001/",//生产环境
12
+    socket_ip: "192.168.8.4",//ip
13
+    socket_port: "8081",//端口
14
+    menuworktime: 30000,//菜单工单数量刷新间隔
15
+    indextime: 30000,//首页报表刷新间隔
16
+    messageTime:60000,
17
+     arr :["<a class='xg' onclick='ckxq(data)' title='查看'>查看</a>",
18
+				"<a class='xg' onclick='bj(data)' title='编辑'>编辑</a>",
19
+				"<a class='xg' onclick='move(data)' title='删除'>删除</a>",
20
+				"<a class='xg' onclick='tj(data)' title='提交'>提交</a>",
21
+				"<a class='xg' onclick='jb(data)' title='交办'>交办</a>", //交办
22
+				"<a class='xg' onclick='lader(data)' title='领导'>领导批示</a>", //领导批示
23
+				"<a class='xg' onclick='city(data)' title='市长'>市长批示</a>", //市长指示
24
+				"<a class='xg' onclick='Supervision(data)' title='督办'>督办</a>", //督办
25
+				"<a class='xg' onclick='Supervision_(data)' title='督察'>监察</a>", //督察
26
+				"<a class='xg' onclick='sh(data)' title='收回'>收回</a>", //收回
27
+				"<a class='xg' onclick='cs(data)' title='查收'>查收</a>", //查收
28
+				"<a class='xg' onclick='th(data)' title='退回申请'>退回申请</a>", //退回申请
29
+				"<a class='xg' onclick='bl(data,isProtect)' title='办理'>办理</a>", //办理
30
+				"<a class='xg' onclick='ys(data)' title='申请延时'>申请延时</a>", //延时申请
31
+				"<a class='xg' onclick='shth(data)' title='退回审核'>退回审核</a>", //退回审核
32
+				"<a class='xg' onclick='hf(data)' title='回访'>回访</a>", //回访
33
+				"<a class='xg' onclick='shys(data)' title='延时审核'>延时审核</a>", //延时审核
34
+				"<a class='xg' onclick='cb(data)' title='重办'>重办</a>", //重办
35
+				"<a class='xg' onclick='Lawsuit(data)' title='结案'>结案</a>", //结案
36
+				"<a class='xg'  title='导出'>导出</a>", //导出
37
+				"<a class='xg' onclick='BackDtail(data)'   title='回退'>回退</a>", //回退
38
+				"<a class='xg' onclick='StrongLawsuit(data)' title='强制结案'>强制结案</a>", //结案
39
+                "<a class='xg' onclick='pd(data)' title='派单'>派单</a>", //派单
40
+                "<a class='xg' onclick='auditdeal(data)' title='处理审核'>处理审核</a>", //处理审核
41
+                "<a class='xg' onclick='sign(data)' title='签收'>签收</a>", //签收
42
+                "<a class='xg' onclick='refuse(data)' title='拒收'>拒收</a>", //拒收
43
+                "<a class='xg' onclick='withdraw(data)' title='撤单'>撤单</a>", //撤单
44
+                "<a class='xg' onclick='audit(data)' title='审核'>审核</a>", //审核
45
+                "<a class='xg' onclick='zdb(data)' title='转督办'>转督办</a>", //转督办
46
+                "<a class='xg' onclick='ndb(data)' title='不督办'>不督办</a>", //不督办
47
+                "<a class='xg' onclick='tjcb(data)' title='提交重办'>提交重办</a>", //重办
48
+                "<a class='xg' onclick='bhcb(data)' title='驳回重办'>驳回重办</a>" ,//重办
49
+                "<a class='xg' onclick='lzjd(data)' title='履职界定'>履职界定</a>" ,//履职界定
50
+                "<a class='xg' onclick='jdsh(data)' title='界定审核 '>界定审核</a>" //界定审核
51
+			],
52
+	 kapArr :["<a class='xg' onclick='goDetail(data,data_id)' title='查看'>查看</a>",
53
+				"<a class='xg' onclick='goEdit(data,data_id)' title='编辑'>编辑</a>",
54
+				"<a class='xg' onclick='goDel(data)' title='删除'>删除</a>",
55
+				"<a class='xg' onclick='tj(data)' title='提交'>提交</a>",
56
+				"<a class='xg' onclick='audit(data)' title='审核'>审核</a>", 
57
+				"<a class='xg' onclick='solve(data)' title='解决'>解决</a>", 
58
+				"<a class='xg' onclick='noSolve(data)' title='未解决'>未解决</a>" 
59
+			]
60
+};

+ 27 - 23
WebChart/TelephoneDetails.html

@@ -146,32 +146,36 @@
146 146
 		            margin-right: 10px;
147 147
 					border-radius: 50%;
148 148
 		        }
149
-		
149
+		/* 通话中 */
150 150
 		.hc {
151
-		    background-color: greenyellow;
151
+		    background-color: greenyellow!important;
152 152
 		}
153
-		
154
-		.ml {
155
-		    background-color: red;
153
+		/*置忙  */
154
+		.ml { 
155
+		    background-color: red!important;
156 156
 		}
157
-		
157
+		/* 空闲 */
158 158
 		.kx {
159
-		    background-color: #55aa7f
159
+		    background-color: #55aa7f!important
160 160
 			}
161
+		/* 振铃 */
161 162
 		.zl {
162
-		    background-color: #00ffff
163
+		    background-color: #00ffff!important
163 164
 		}
164 165
 		
165 166
 		.qc {
166
-              background-color: #00ffff
167
+              background-color: #00ffff!important
167 168
 		}
168
-		
169
+		/* 离线 */
169 170
 		.lx {
170
-		  background-color: #555500
171
+		  background-color: darkgray!important
171 172
 		}
172
-		
173
+		/* 化后 */
173 174
 		.hh {
174
-		      background-color: #ff55ff
175
+		      background-color: #ff55ff!important
176
+		}
177
+		.dark{
178
+			background-color: darkgray!important;
175 179
 		}
176 180
 		/*坐席监控*/
177 181
 		
@@ -251,39 +255,39 @@
251 255
 		
252 256
 		.zx {
253 257
 		    /*background: #989898;*/
254
-		    background: #61b960;
258
+		    	background-color: #61b960!important;
255 259
 		}
256 260
 		
257 261
 		.jt {
258
-		    background: #5ed7b7;
262
+		    	background-color: #5ed7b7!important;
259 263
 		}
260 264
 		
261 265
 		.dj {
262
-		    background: #bed75b;
266
+		    	background-color: #bed75b!important;
263 267
 		}
264 268
 		
265 269
 		.qca {
266
-		    background: #d75e7c;
270
+		    	background-color: #d75e7c!important;
267 271
 		}
268 272
 		
269 273
 		.lj {
270
-		    background: #5daed8;
274
+		    	background-color: #5daed8!important;
271 275
 		}
272 276
 		
273 277
 		.qc {
274
-		    background: #d8988f;
278
+		    	background-color: #d8988f!important;
275 279
 		}
276 280
 		
277 281
 		.kqc {
278
-		    background: #44af3c;
282
+		    	background-color: #44af3c!important;
279 283
 		}
280 284
 		
281 285
 		.jqc {
282
-		    background: #d91e06;
286
+		    	background-color: #d91e06!important;
283 287
 		}
284 288
 		
285 289
 		.dis {
286
-		    background: #989898;
290
+		    	background-color: #989898!important;
287 291
 		}
288 292
 		
289 293
 		.users{
@@ -366,7 +370,7 @@
366 370
 					<li class="touxiang">
367 371
 						<ol class="tx">
368 372
 							<li class="person">
369
-								<span class="yuan_one"></span>
373
+								<span class="yuan_one qc"></span>
370 374
 								<span class="yuan_two"></span>
371 375
 							</li>
372 376
 							<li class="userid">8082</li>

+ 13 - 4
WebChart/css/index.css

@@ -247,6 +247,7 @@ a {
247 247
 	float: left;
248 248
 	box-sizing: border-box;
249 249
 	padding-top: 140px;
250
+	margin-right: 10px;
250 251
 }
251 252
 
252 253
 .slide_left,
@@ -270,7 +271,7 @@ a {
270 271
 .orderStatistic>.orderCon_left {
271 272
 	box-sizing: border-box;
272 273
 	padding-left: 120px;
273
-	margin-top: 20px;
274
+	margin-top: 60px;
274 275
 }
275 276
 
276 277
 .orderStatistic>div>ul li {
@@ -288,8 +289,16 @@ a {
288 289
 	display: inline-block;
289 290
 	vertical-align: middle;
290 291
 }
291
-
292
-.orderli:nth-child(n+6) {
292
+.right_box{
293
+	overflow-y: scroll;
294
+	margin-top: 60px;
295
+	height: 620px;
296
+	margin-right: 25px;
297
+}
298
+.right_box::-webkit-scrollbar {
299
+display: none;
300
+}
301
+/* .orderli:nth-child(n+6) {
293 302
 	position: absolute !important;
294 303
 	right: 125px !important;
295 304
 }
@@ -313,7 +322,7 @@ a {
313 322
 .orderli:nth-child(10) {
314 323
 	top: 660px !important;
315 324
 }
316
-
325
+ */
317 326
 .slideCon_bg>div>ul li .num_word {
318 327
 	display: inline-block;
319 328
 	vertical-align: middle;

+ 2 - 2
WebChart/css/main.css

@@ -107,13 +107,13 @@ p {
107 107
 }
108 108
 .map_bg{
109 109
 	width: 60%;
110
-	    margin: -215px 0px 0px 190px;
110
+	    margin: -250px 0px 0px 190px;
111 111
 }
112 112
 #radarBox{
113 113
 	width: 170px!important;
114 114
 	height: 170px!important;
115 115
 	    margin-left: -86px;
116
-	    top: 4px;
116
+	    top: -13px;
117 117
 }
118 118
 .radar{
119 119
 	width: 150px!important;

+ 29 - 10
WebChart/detail.html

@@ -125,6 +125,11 @@
125 125
 			display: block;
126 126
 			height: 170px;
127 127
 		}
128
+		.onewrap{
129
+			height: 820px;
130
+			/* overflow: hidden; */
131
+			overflow-y: scroll;
132
+		}
128 133
 		</style>
129 134
 	</head>
130 135
 
@@ -142,7 +147,7 @@
142 147
 		<!-- <div class="wrap"> -->
143 148
 			<div class="boxwrap">
144 149
 					<!--第一屏  工单统计-->
145
-						<div class="slideCon_bg_block orderStatistic slideCon_bg clearfix" >
150
+						<div class=" slideCon_bg_block orderStatistic slideCon_bg clearfix" >
146 151
 							<p class="slide_title slide_title1"></p>
147 152
 							<!--<div class="timeWrap twotimeWarp firstPos">
148 153
 								<div class="time_box pull-right form-inline">
@@ -175,6 +180,20 @@
175 180
 									<li class="orderli">
176 181
 										<img src="img/num_icon.png" alt="" />
177 182
 										<p class="num_word">
183
+											<span>龙安区</span>
184
+											<span class="LAQ_num">0</span>
185
+										</p>
186
+									</li>
187
+									<li class="orderli">
188
+										<img src="img/num_icon.png" alt="" />
189
+										<p class="num_word">
190
+											<span>安阳县</span>
191
+											<span class="AYX_num">0</span>
192
+										</p>
193
+									</li>
194
+									<!-- <li class="orderli">
195
+										<img src="img/num_icon.png" alt="" />
196
+										<p class="num_word">
178 197
 											<span>殷都区</span>
179 198
 											<span class="YDQ_num">0</span>
180 199
 										</p>
@@ -224,7 +243,7 @@
224 243
 											<span class="LZS_num">0</span>
225 244
 										</p>
226 245
 									</li>
227
-								</ul>
246
+								</ul> -->
228 247
 							</div>
229 248
 							
230 249
 							<div class="orderCon_middle slide_middle_first">
@@ -379,21 +398,21 @@
379 398
 						
380 399
 							<div class="orderCon_right slide_right">
381 400
 								<div class="timeWrap">
382
-									<div class="time_box pull-right form-inline"style="margin:0px 60px 0 0;">
401
+									<div class="time_box pull-right form-inline"style="margin:10px 75px 0 0;">
383 402
 										日期<input type="text" id="time1" class="times" />
384 403
 										<!-- <img src="img/rili.png" class="data-input-icon1" /> -->
385 404
 									</div>
386 405
 								</div>
387
-								<!-- <ul id="right_ri">
406
+								<ul id="right_ri" class="right_box" >
388 407
 									
389
-									<li>
408
+									<li class="orderli">
390 409
 										<img src="img/num_icon.png" alt="" />
391 410
 										<p class="num_word">
392 411
 											<span>安阳县</span>
393 412
 											<span class="AYX_num">0</span>
394 413
 										</p>
395 414
 									</li>
396
-									<li>
415
+									<li class="orderli">
397 416
 										<img src="img/num_icon.png" alt="" />
398 417
 										<p class="num_word">
399 418
 											<span>汤阴县</span>
@@ -401,7 +420,7 @@
401 420
 										</p>
402 421
 									</li>
403 422
 									
404
-									<li>
423
+									<li class="orderli">
405 424
 										<img src="img/num_icon.png" alt="" />
406 425
 										<p class="num_word">
407 426
 											<span>内黄县</span>
@@ -416,7 +435,7 @@
416 435
 										</p>
417 436
 									</li>
418 437
 									
419
-									<li>
438
+								<li class="orderli">
420 439
 										<img src="img/num_icon.png" alt="" />
421 440
 										<p class="num_word">
422 441
 											<span>林州市</span>
@@ -424,7 +443,7 @@
424 443
 										</p>
425 444
 									</li>
426 445
 									
427
-								</ul> -->
446
+								</ul>
428 447
 							</div>
429 448
 						</div>
430 449
 				
@@ -703,7 +722,7 @@
703 722
 		<script src="plugins/numbergd/index.js"></script>
704 723
 		<script src="js/tagcloud.js"></script>
705 724
 		<script src="js/ScrollDiv.js"></script>
706
-		<script src="js/index.js"></script>
725
+		<script src="js/detail.js"></script>
707 726
 			<!-- <script src="js/complaintsReport.js"></script>
708 727
 		<script src="js/TelephoneDetails.js" type="text/javascript" charset="utf-8"></script>
709 728
 		<script src="js/receiptDepartment.js" type="text/javascript" charset="utf-8"></script>

binární
WebChart/img/background01.png


binární
WebChart/img/background05.png


binární
WebChart/img/background07.png


+ 434 - 7
WebChart/js/TelephoneDetails.js

@@ -1,5 +1,18 @@
1 1
 	var areaOneVal = helper.cookies.get("areaOneVal");
2 2
 	var areaOneText = helper.cookies.get("areaOneText");
3
+	// 如果浏览器不支持websocket,会使用这个flash自动模拟websocket协议,此过程对开发者透明
4
+	WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
5
+	// 开启flash的websocket debug
6
+	WEB_SOCKET_DEBUG = true;
7
+	var ws, n = 0,
8
+		timer;
9
+	var lockReconnect = false; //避免重复连接
10
+	var obj = {};
11
+	var Statess;
12
+	var cls = 0;
13
+	var lasttime = new Date().getTime();
14
+	var cons;
15
+	var person='';
3 16
 	if (areaOneVal) {
4 17
 		var areaOneVal = helper.cookies.get("areaOneVal");
5 18
 		
@@ -7,7 +20,377 @@
7 20
 		var areaOneVal="sqs12345"
8 21
 		
9 22
 	}
23
+	//创建scoket连接
24
+	function createWebSocket() {
25
+	    try {
26
+	       
27
+	        Connect();
28
+	    } catch (e) {
29
+	        reconnect();
30
+	    }
31
+	}
32
+	//连接
33
+	function Connect() {
34
+		// debugger
35
+	    ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
36
+	    ws.onopen = function () {
37
+	        console.log(new Date() + "    " + "建立连接");
38
+	        //心跳检测重置
39
+	        heartCheck.reset().start();
40
+	        cls = 0;
41
+	        // $(".Login").addClass("active");
42
+	        lasttime = new Date().getTime();
43
+			
44
+	     join()
45
+		 SayBusy()
46
+	        //自动签入
47
+	        // if ($.cookie("socket_state") != null) {
48
+	            // SetLogin($.cookie("socket_state"));
49
+	        // }
50
+	        //$(".hwzt").text('连接成功!');
51
+	    };
52
+	    //接收到消息的回调方法
53
+	    ws.onmessage = function (evt) {
54
+	        //如果获取到消息,心跳检测重置
55
+	        //拿到任何消息都说明当前连接是正常的
56
+	        heartCheck.reset().start();
57
+	        var myDate = new Date();
58
+	        console.log(myDate + "  receive  " + evt.data);
59
+	        var data = JSON.parse(evt.data)[0];
60
+	        if (data) {
61
+	            var rlt = data.Result;
62
+				  var type = data.Type;
63
+	            if (rlt == true) {
64
+	              
65
+	                switch (type.toLowerCase()) {
66
+	                    //case "heart": HeartBack(); break;//心跳
67
+	                    case "login":
68
+	                        LoginBack();
69
+	                        break; //签入
70
+	                  // case "logout":
71
+	                  //     LogoutBack();
72
+	                  //     break; //签出
73
+	                  // case "dropcall":
74
+	                  //     DropCallBack();
75
+	                  //     break; //挂断
76
+	                  case "makecall":
77
+	                      MakeCallBack();
78
+	                      break; //外呼
79
+	                  case "setstate":
80
+	                      SetState(data);
81
+	                      break; //置忙置闲
82
+	                      //case "saybusy": SayBusyBack(data); break;
83
+	                      //case "sayfree": SayFreeBack(data); break;
84
+	                  case "meeting":
85
+	                      MeetingBack();
86
+	                      break; //多方通话
87
+	                  case "transfer":
88
+	                      TransferBack();
89
+	                      break; //转移
90
+	                  case "hold":
91
+	                      HoldBack();
92
+	                      break; //保持
93
+	                  case "retrieve":
94
+	                      RetrieveBack();
95
+	                      break; //接回
96
+	                  // case "incoming":
97
+	                  //     IncomingBack(data);
98
+	                  //     break; //来电
99
+	                  case "subscribe":
100
+	                      SubScribeBack();
101
+	                      break; //监测
102
+	                  case "subscribecancel":
103
+	                      SubScribeCancelBack();
104
+	                      break; //停止监测
105
+	                  case "agentstate":
106
+	                      AgentStateBack(data);
107
+	                      break; //坐席状态
108
+	                  case "linestate":
109
+	                      LineStateBack(data);
110
+	                      break; //线路状态
111
+	                  case "motorsetstate":
112
+	                      SayFreeBack();
113
+	                      break; //班长置闲
114
+	                  // case "linestateagent":
115
+	                  //     LineStateAgentBack(data);
116
+	                  //     break; //线路状态通知
117
+	                  case "agentstateagent":
118
+	                      AgentStateAgentBack(data);
119
+	                      break; //坐席状态通知
120
+	                  //case "callid":
121
+	                  //    CallIDBack(data);
122
+	                  //    break; //获取callid
123
+	                  //case "recordpath":
124
+	                  //    RecordPathBack(data);
125
+	                  //    break; //录音返回
126
+	                  case "getagentlist":
127
+	                      GetAgentListBack(data);
128
+	                      break;//在线坐席信息
129
+	                  case "confirmtransfer":
130
+	                      ConfirmTransfer(data);
131
+	                      break;//确认转移 取消转移
132
+	                  case "consult":
133
+	                      ConsultationCall();
134
+	                      break;//协商呼叫
135
+	                
136
+	                }
137
+	            } else {
138
+	                if (rlt == false) {
139
+	                    //layer.confirm('操作失败!', {
140
+	                    //    btn: ['确定'] 
141
+	                    //});
142
+	                    $(".hwzt").text('操作失败!');
143
+	                } else {
144
+	                    $(".hwzt").text(rlt);
145
+	                    //layer.confirm(rlt, {
146
+	                    //    btn: ['确定']
147
+	                    //});
148
+						  if(type.toLowerCase()=='waitcount') {
149
+							   backstageQueue(data);
150
+							  }
151
+	                }
152
+	            }
153
+	        }
154
+	    };
155
+	    
156
+	    //连接关闭的回调方法
157
+	    ws.onclose = function (evt) {
158
+	        if (cls == 0) {
159
+	            cls = 1;
160
+	            //console.log("连接关闭!");
161
+	            //layer.confirm('连接关闭!', {
162
+	            //    btn: ['确定']
163
+	            //});
164
+	            $(".hwzt").text('连接关闭!');
165
+	            $("#top-search li i").removeClass("active");
166
+	            reconnect();
167
+	        }
168
+	    };
169
+	    //连接发生错误的回调方法
170
+	    ws.onerror = function (evt) {
171
+	        //产生异常
172
+	        $(".hwzt").text('连接出现异常!');
173
+	        console.log(ws);
174
+	        if (ws == null || ws.readyState != ws.OPEN) {
175
+	            console.log(new Date() + "开始重连");
176
+	            reconnect();
177
+	        }
178
+	
179
+	    };
180
+	}
181
+	//重连
182
+	function reconnect() {
183
+		
184
+	    if (lockReconnect) return;
185
+	    lockReconnect = true;
186
+	    //没连接上会一直重连,设置延迟避免请求过多
187
+	    setTimeout(function () {
188
+	        console.log(new Date() + "    " + "重连中……");
189
+	        createWebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
190
+	        lockReconnect = false;
191
+			SayBusy()
192
+	    }, 2000);
193
+	}
194
+	
195
+	//发送
196
+	function Send() {
197
+	    if (ws.readyState != ws.OPEN) {
198
+	        reconnect();
199
+	    }
200
+	    if (ws.readyState == ws.OPEN) {
201
+	        console.log(new Date() + "  send  " + JSON.stringify(obj));
202
+	        ws.send(JSON.stringify(obj));
203
+	    }
204
+	}
205
+	//心跳检测
206
+	var heartCheck = {
207
+	    timeout: 25000, //25秒
208
+	    timeoutObj: null,
209
+	    serverTimeoutObj: null,
210
+	    reset: function () {
211
+	        clearTimeout(this.timeoutObj);
212
+	        clearTimeout(this.serverTimeoutObj);
213
+	        return this;
214
+	    },
215
+	    start: function () {
216
+	        var self = this;
217
+	        this.timeoutObj = setTimeout(function () {
218
+	            //这里发送一个心跳,后端收到后,返回一个心跳消息,
219
+	            //onmessage拿到返回的心跳就说明连接正常
220
+	            obj.Type = "Heart";
221
+	            Send();
222
+	            self.serverTimeoutObj = setTimeout(function () { //如果超过一定时间还没重置,说明后端主动断开了
223
+	                ws.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
224
+	            }, self.timeout)
225
+	        }, this.timeout)
226
+	    }
227
+	}
228
+	// 签入
229
+	function SayBusy() {
230
+		obj.Type = "SayBusy";
231
+		Send();
232
+		console.log('置忙')
233
+	}
234
+	
235
+	//签入
236
+	function LoginBack() {
237
+	    
238
+	  obj.Type = "SayBusy";
239
+	  Send();
240
+	  console.log('置忙')
241
+	}
242
+	// 点击签入
243
+	function join(){
244
+	            obj.Type ='Login',
245
+		        obj.AgentID='9898',
246
+		        obj.AgentExten='1015',
247
+		        obj.AgentType='0',
248
+				obj.AgentGroup='364'
249
+		       
250
+		      
251
+			  // console.log(scoketDatas)
252
+		      Send()
253
+	}
254
+	//监测
255
+	function SubScribeBack() {
256
+	    var obj = $("iframe:visible")
257
+	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
258
+	        window.frames[obj.attr("name")].Start();
259
+	    }
260
+	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
261
+	        window.frames[obj.attr("name")].Start();
262
+	    }
263
+	}
264
+	//取消监测
265
+	function SubScribeCancelBack() {
266
+	    // var obj = $("iframe:visible")
267
+	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
268
+	    //     window.frames[obj.attr("name")].Stop();
269
+	    // }
270
+	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
271
+	    //     window.frames[obj.attr("name")].Stop();
272
+	    // }
273
+		$('.yuan_one').addClass("lx")
274
+		$('.yuan_two').addClass("lx")
275
+	}
276
+	//班长监测返回状态
277
+	//坐席状态
278
+	
279
+	function AgentStateBack(data) {
280
+		$('.yuan_one').removeClass("lx")
281
+		$('.yuan_two').removeClass("lx")
282
+		$(cons).each(function (i, n) {
283
+			if(n.F_UserCode==data.AgentID){
284
+				if(data.State=='0'){
285
+					$('.yuan_one').eq(i).addClass("lx")
286
+					$('.yuan_two').eq(i).addClass("lx")
287
+				}else if(data.State=='2'){
288
+					$('.yuan_one').eq(i).addClass("kx")
289
+					$('.yuan_two').eq(i).addClass("kx")
290
+				}else if(data.State=='3'){
291
+					$('.yuan_one').eq(i).addClass("hc")
292
+					$('.yuan_two').eq(i).addClass("hc")
293
+				}else if(data.State=='4'){
294
+					$('.yuan_one').eq(i).addClass("hh")
295
+					$('.yuan_two').eq(i).addClass("hh")
296
+				}else if(data.State=='5'){
297
+					$('.yuan_one').eq(i).addClass("ml")
298
+					$('.yuan_two').eq(i).addClass("ml")
299
+				}else if(data.State=='6'){
300
+					$('.yuan_one').eq(i).addClass("zl")
301
+					$('.yuan_two').eq(i).addClass("zl")
302
+				}
303
+				
304
+			}
305
+			})
306
+	    // var obj = $("iframe:visible")
307
+	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
308
+	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
309
+	    // }
310
+	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
311
+	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
312
+	    // }
313
+	}
314
+	//线路状态
315
+	function LineStateBack(data) {
316
+	    var obj = $("iframe:visible")
317
+	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
318
+	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
319
+	    }
320
+	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
321
+	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
322
+	    }
323
+	}
324
+	//后台排队
325
+	function backstageQueue(data) {
326
+		
327
+		person=data.WaitCount
328
+		console.log(person)
329
+	    // if (obj.attr("data-id") == "./widgets.html") {
330
+	    //     window.frames[obj.attr("name")].realTimeMonitorQueue(data.WaitCount);
331
+	    // }
332
+	}
333
+	//坐席状态通知
334
+	function AgentStateAgentBack(data) {
335
+	    var strr = '';
336
+	    console.log('坐席状态'+ data.State );
337
+	    switch (data.State+"") {
338
+	        case "0":
339
+	            strr = "离线";
340
+	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
341
+	            break; //离线
342
+	        case "1":
343
+	            break; //登录中
344
+	        case "2":
345
+	            strr = "空闲";
346
+	            $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
347
+	            break; //空闲
348
+	        case "3":
349
+	            strr = "通话中";
350
+	            $(".zxzt").removeClass("bl").removeClass("by").addClass("br");
351
+	            break; //通话中
352
+	        case "4":
353
+	            strr = "话后处理中";
354
+	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
355
+	            break; //话后处理中
356
+	        case "5":
357
+	            strr = "忙碌";
358
+	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
359
+	            break; //小休
360
+	        case "6":
361
+	            strr = "振铃";
362
+	            break; //被请求
363
+	        case "7":
364
+	            strr = "注销";
365
+	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
366
+	            break; //注销
367
+	    }
368
+	
369
+	    $(".hxzt").text(strr);
370
+	}
371
+	
372
+	//置忙 置闲
373
+	function SetState(obj) {
374
+	    if (obj.State == '5') {
375
+	        $(".SayBusy").removeClass("active");
376
+	        $(".SayFree").addClass("active");
377
+	        $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
378
+	        $(".hwzt").text('忙碌');
379
+	        $("#isml").val(1);
380
+	        // SetStateCookie(1);
381
+	    }
382
+	    if (obj.State == '2') {
383
+	    	$(".SayBusy").addClass("active");
384
+	        $(".SayFree").removeClass("active");
385
+	        $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
386
+	        $(".hwzt").text('空闲');
387
+	        $("#isml").val(0);
388
+	        // SetStateCookie(0);
389
+	    }
390
+	}
10 391
 	$(function() {
392
+		createWebSocket()
393
+		 SayBusy()
11 394
 		laydate.render({
12 395
 			elem: '#time1',
13 396
 			range: '~',
@@ -197,11 +580,10 @@
197 580
 			success: function(data) {
198 581
 				if(data.state.toLowerCase() == 'success') {
199 582
 					// 	   			layer.close(index);
200
-					var con = data.data;
201
-					console.log(con)
583
+					 cons = data.data;
202 584
 					$(".users").html('')
203
-						$(con).each(function(i, n) {
204
-						var str=' <li class="touxiang"><ol class="tx"><li class="person"><span class="yuan_one"></span><span class="yuan_two"></span></li><li class="userid">'+n.F_UserCode+'</li></ol></li>';
585
+						$(cons).each(function(i, n) {
586
+						var str=' <li class="touxiang"><ol class="tx"><li class="person"><span class="yuan_one "></span><span class="yuan_two"></span></li><li class="userid">'+n.F_UserCode+'</li></ol></li>';
205 587
 						    var a=$(str)
206 588
 						    a.appendTo($(".users"))
207 589
 								   })
@@ -212,7 +594,50 @@
212 594
 			
213 595
 		});
214 596
 	}
597
+	// 开始检测
598
+ $(".kqc").click(function () {
599
+                // if (!$(this).hasClass("dis")) {
215 600
 
601
+                    $(cons).each(function (i, n) {
602
+                       obj.Type = "SubScribe";
603
+                       obj.SubParmer = n.F_WorkNumber * 1;
604
+
605
+                       obj.SubType = "0";//根据工号订阅坐席状态
606
+                       Send();
607
+                       obj.SubType = "1";//根据工号订阅线路状态
608
+                       Send();
609
+                    })
610
+                    //top.obj.Type = "SubScribe";
611
+                    //top.obj.SubParmer = "8003";
612
+
613
+                    //top.obj.SubType = "0";//根据工号订阅坐席状态
614
+                    //top.Send();
615
+                    //top.obj.SubType = "1";//根据工号订阅线路状态
616
+                    //top.Send();
617
+                // }
618
+            })
619
+			
620
+			
621
+			//停止监测
622
+			$(".jqc").click(function () {
623
+			        //$(user).each(function (i, n) {
624
+			        //   obj.Type = "SubScribeCancel";
625
+			        //   obj.SubParmer = n.F_WorkNumber;
626
+			
627
+			        //   obj.SubType = "0";//根据工号取消订阅坐席状态
628
+			        //   Send();
629
+			        //   obj.SubType = "1";//根据工号取消订阅线路状态
630
+			        //   Send();
631
+			        //})
632
+			       obj.Type = "SubScribeCancel";
633
+			       obj.SubParmer = "-1";
634
+			
635
+			       obj.SubType = "0";//根据工号取消订阅坐席状态
636
+			       Send();
637
+			       obj.SubType = "1";//根据工号取消订阅线路状态
638
+			       Send();
639
+			    
640
+			})
216 641
 	//part 2
217 642
 	var phoneTimeCount = echarts.init(document.getElementById('phoneTimeCount'));
218 643
 	phoneTimeCount.setOption({
@@ -363,7 +788,7 @@
363 788
 		},
364 789
 		xAxis: {
365 790
 			name: '类型',
366
-			data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
791
+			data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)","排队人数"],
367 792
 			axisLine: {
368 793
 				lineStyle: {
369 794
 					color: '#3061a2'
@@ -407,7 +832,7 @@
407 832
 					color: function(params) {
408 833
 						// build a color map as your need.
409 834
 						var colorList = [
410
-							'#368cab', '#54b793', '#4b6ab0', '#2531a9'
835
+							'#368cab', '#54b793', '#4b6ab0', '#2531a9','#a93d19'
411 836
 						];
412 837
 						return colorList[params.dataIndex]
413 838
 					}
@@ -442,9 +867,11 @@
442 867
 				if(data.state.toLowerCase() == "success") {
443 868
 					//					layer.close(index);
444 869
 					var con = data.data;
870
+					con.person=person
871
+					console.log(con)
445 872
 					todyPhoneCount.setOption({
446 873
 						series: [{
447
-							data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes]
874
+							data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes,con.person]
448 875
 						}]
449 876
 
450 877
 					})

+ 599 - 0
WebChart/js/detail.js

@@ -0,0 +1,599 @@
1
+var newData = [] //数据倒序
2
+var floag = true
3
+
4
+// var areaOneVal = helper.cookies.get("areaOneVal");
5
+// var areaOneText = helper.cookies.get("areaOneText");
6
+// if (areaOneVal) {
7
+// 	var areaOneVal = helper.cookies.get("areaOneVal");
8
+
9
+// } else{
10
+// 	var areaOneVal="sqs12345"
11
+
12
+// }
13
+$(function() {
14
+
15
+	loginTimeLimit(); //登录
16
+
17
+	var mySwiper = new Swiper('.swiper-container', {
18
+		//		loop: true,
19
+		//		autoplay: {
20
+		//			delay: 60000,
21
+		//		},
22
+		pagination: { /* 分页器*/
23
+			el: '.swiper-pagination',
24
+			clickable: true,
25
+		},
26
+		navigation: {
27
+			nextEl: '.swiper-button-next',
28
+			prevEl: '.swiper-button-prev',
29
+		},
30
+		//				followFinger : false,
31
+		//				speed:800,
32
+		on: {
33
+			init: function() {
34
+				swiperAnimateCache(this); //隐藏动画元素 
35
+				swiperAnimate(this); //初始化完成开始动画
36
+			},
37
+			transitionEnd: function() {
38
+				swiperAnimate(this); //每个slide切换结束时也运行当前slide动画
39
+
40
+			},
41
+		}
42
+
43
+	})
44
+	// 跳轉
45
+	$(".nav_middle").click(function() {
46
+		window.open('index.html', '_self')
47
+	})
48
+	$("#department").click(function() {
49
+		window.open('receiptDepartment.html', '_self')
50
+	})
51
+	$("#sourceChannel").click(function() {
52
+		window.open('sourceChannel.html', '_self')
53
+	})
54
+	$("#call").click(function() {
55
+		window.open('TelephoneDetails.html', '_self')
56
+	})
57
+	$("#complaint").click(function() {
58
+		window.open('complaintsReport.html', '_self')
59
+	})
60
+	// 選項卡
61
+	$(".smallimg").click(function() {
62
+		//获取点击的元素给其添加样式,讲其兄弟元素的样式移除
63
+		$(this).addClass("activeBox").siblings().removeClass("activeBox");
64
+		//获取选中元素的下标
65
+		var index = $(this).index();
66
+		$(".slideCon_bg").eq(index).addClass("slideCon_bg_block")
67
+			.siblings().removeClass("slideCon_bg_block");
68
+	});
69
+	Ajax();
70
+	deprtment(); // 第五屏部门下拉
71
+	laydate.render({
72
+		elem: '#time1',
73
+		range: '~',
74
+		format: 'yyyy-MM-dd',
75
+		theme: '#114a97',
76
+		done: function(value, date) {
77
+			oneScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1])
78
+		}
79
+	});
80
+	laydate.render({
81
+		elem: '#time2',
82
+		range: '~',
83
+		format: 'yyyy-MM-dd',
84
+		theme: '#114a97',
85
+		done: function(value, date) {
86
+			twoScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1], $(".areaTwo").val())
87
+			satisfaction(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1], $(".areaTwo").val())
88
+		}
89
+	});
90
+	laydate.render({
91
+		elem: '#time3',
92
+		format: 'yyyy-MM-dd',
93
+		theme: '#114a97',
94
+		done: function(value) {
95
+			threeScreen(value, $(".areaThree").val())
96
+		}
97
+	});
98
+	laydate.render({
99
+		elem: '#test6',
100
+		range: '~',
101
+		format: 'yyyy-MM-dd',
102
+		theme: '#114a97',
103
+		done: function(value, date) {
104
+			fiveScreen(value && value.split(' ~ ')[0], value && value.split(' ~ ')[1], $(".areaFive").val())
105
+		}
106
+	});
107
+})
108
+var cityObj = {
109
+	ele1: "sqs_count",
110
+	ele2: "syq_count",
111
+	ele3: "lyq_count",
112
+	ele4: "ycs_count",
113
+	ele5: "mqx_count",
114
+	ele6: "sx_count",
115
+	ele7: "nlx_count",
116
+	ele8: "zcx_count",
117
+	ele9: "ycx_count",
118
+	ele10: "xyx_count",
119
+	ele11: "cxyt_count",
120
+	ele12: "lhpz_count",
121
+	ele13: "saz_count",
122
+	ele14: "djbl_count"
123
+}
124
+var vars = {};
125
+getCountUp(cityObj)
126
+
127
+function getCountUp(obj1) {
128
+	var options = {
129
+		useEasing: true,
130
+		useGrouping: true,
131
+		separator: ',',
132
+		decimal: '.',
133
+	};
134
+	$.each(obj1, function(k, v) {
135
+		new CountUp(v, 0, 0, 0, 2, options).start()
136
+		vars[v] = new CountUp(v, 0, 0, 0, 2, options)
137
+	})
138
+}
139
+
140
+var myDate = new Date();
141
+
142
+function turn(aa) {
143
+	if (aa < 10) {
144
+		aa = "0" + aa;
145
+	}
146
+	return aa
147
+}
148
+// 第三屏 第四屏 发光外框 定时
149
+(function() {
150
+	var i = 0;
151
+	var length = $(".orderState_ul >li").length;
152
+	var j = 0;
153
+	var length_1 = $(".orderTtype_Con li").length;
154
+	setInterval(function() {
155
+		if (i == length) {
156
+			i = 0;
157
+			$(".orderState_ul >li").removeClass('active');
158
+		}
159
+		$(".orderState_ul >li").eq(i).addClass('active').siblings().removeClass('active');
160
+		if (i == 5) {
161
+			$(".orderState_ul >li").eq(4).removeClass('active');
162
+		}
163
+		i++;
164
+
165
+		if (j == length_1) {
166
+			j = 0;
167
+		}
168
+		$(".orderTtype_Con li").eq(j).addClass('active').siblings().removeClass('active');
169
+		j++;
170
+	}, 2000);
171
+})();
172
+//对数组进行排序
173
+function compare(property) {
174
+	return (firstobj, secondobj) => {
175
+		const firstValue = firstobj[property];
176
+		const secondValue = secondobj[property];
177
+		return secondValue - firstValue; //降序
178
+	};
179
+}
180
+//第一屏幕 开始
181
+function oneScreen(sd, ed) {
182
+	$.ajax({
183
+		type: "get",
184
+		url: huayi.config.callcenter_url + "/info/GetAreaCountByDateNew",
185
+		async: true,
186
+		dataType: 'json',
187
+		data: {
188
+			start: sd,
189
+			end: ed,
190
+		},
191
+		success: function(data) {
192
+			if (data.state.toLowerCase() == 'success') {
193
+				var con = data.data;
194
+				newData = con.sort(compare("SLCount"));
195
+				console.log(1)
196
+				$(newData).each(function(i, n) {
197
+					if (n.AreaName == '安阳市') {
198
+						n.AreaName = "市区"
199
+					}
200
+					// 	if(n.AreaName.indexOf('安阳市') != -1) {
201
+					// 		$(".AY_num").html(n.SLCount)
202
+					// 	}
203
+					// 	if(n.AreaName.indexOf('文峰区') != -1) {
204
+					// 		$(".WFQ_num").html(n.SLCount)
205
+					// 	}
206
+					// 	if(n.AreaName.indexOf('北关区') != -1) {
207
+					// 		$(".BGQ_num").html(n.SLCount)
208
+					// 	}
209
+					// 	if(n.AreaName.indexOf('殷都区') != -1) {
210
+					// 		$(".YDQ_num").html(n.SLCount)
211
+					// 	}
212
+					// 	if(n.AreaName.indexOf('龙安区') != -1) {
213
+					// 		$(".LAQ_num").html(n.SLCount)
214
+					// 	}
215
+					// 	if(n.AreaName.indexOf('安阳县') != -1) {
216
+					// 		$(".AYX_num").html(n.SLCount)
217
+					// 	}
218
+					// 	if(n.AreaName.indexOf('汤阴县') != -1) {
219
+					// 		$(".TYX_num").text(n.SLCount)
220
+					// 	}
221
+					// 	if(n.AreaName.indexOf('内黄县') != -1) {
222
+					// 		$(".NHX_num").html(n.SLCount)
223
+					// 	}
224
+					// 	if(n.AreaName.indexOf('滑县') != -1) {
225
+					// 		$(".HX_num").html(n.SLCount)
226
+					// 	}
227
+					// 	if(n.AreaName.indexOf('林州市') != -1) {
228
+					// 		$(".LZS_num").html(n.SLCount)
229
+					// 	}
230
+					if (floag == true) {
231
+						$("#det_ult").html('')
232
+						$(".right_box").html('')
233
+						$(newData).each(function(i, n) {
234
+							if (i < 5) {
235
+								var str = ' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>' + n.AreaName +
236
+									'</span><span class="AY_num">' + n.SLCount + '</span></p></li>';
237
+								var a = $(str)
238
+								a.appendTo($("#det_ult"))
239
+							}
240
+							if (i >= 5) {
241
+								var str = ' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>' + n.AreaName +
242
+									'</span><span class="AY_num">' + n.SLCount + '</span></p></li>';
243
+								var a = $(str)
244
+								a.appendTo($(".right_box"))
245
+							}
246
+						})
247
+
248
+						floag = false
249
+					}
250
+					if (n.AreaName.indexOf('总计') != -1) {
251
+						$(".allSLCount").html(n.SLCount); //受理量
252
+						$(".allJACount").html(n.JACount); //结案量
253
+						//$(".allJARate").html(n.JARate); //结案量
254
+						$(".allJARate").html("93%"); //结案量
255
+						$(".allMYRate").html('94.09%'); //满意度
256
+					}
257
+				})
258
+			}
259
+		}
260
+	});
261
+}
262
+
263
+function aa() {
264
+
265
+
266
+}
267
+//第二屏
268
+function twoScreen(start, end, areaTwoVal) {
269
+	//	if(!areaTwoVal) {
270
+	//		areaTwoVal = "sqs12345"
271
+	//	}
272
+	$.ajax({
273
+		type: "get",
274
+		url: huayi.config.callcenter_url + "info/GetSourceByDateNew",
275
+		async: true,
276
+		dataType: 'json',
277
+		data: {
278
+			start: start,
279
+			end: end,
280
+			branchcode: areaTwoVal
281
+		},
282
+		success: function(data) {
283
+			if (data.state.toLowerCase() == 'success') {
284
+				//layer.close(index);
285
+				$('.orderSource ul li .rectangle').remove();
286
+				var con = data.data;
287
+				var obj = con[0];
288
+				var con_list = [];
289
+				con_list = con.shift();
290
+				con.splice(3, 0, obj);
291
+				var Percent;
292
+				$(con).each(function(i, n) {
293
+					// if(n.Source.indexOf('信箱') != -1) {
294
+					// 	n.Source = '市长信箱'
295
+					// }
296
+					// if(n.Source.indexOf('APP') != -1) {
297
+					// 	n.Source = 'APP'
298
+					// }
299
+					// if(n.Source.indexOf('政务') != -1) {
300
+					// 	n.Source = '政务网'
301
+					// }
302
+					var str = '<div class="source_kuang rectangle">' +
303
+						'<div class="pbout">' +
304
+						'<div class="percent_box">' +
305
+						'<div class="percent_out"></div>	' +
306
+						' <div class="percent_in"></div>' +
307
+						' <div class="percent_word"><p>' + n.Rate.split('%')[0] + '%' + '</p><p style="margin-top: 30px;">占总量</p>' +
308
+						'</div>' +
309
+						'</div>' +
310
+						'</div>' +
311
+						'<p class="num_word nw">' +
312
+						'<span>' + n.Source + '</span><span>' + n.Count + '</span>' +
313
+						'</p>' +
314
+						'</div>'
315
+					$('.orderSource ul li').eq(i).prepend(str)
316
+				})
317
+			}
318
+		}
319
+	});
320
+}
321
+
322
+//第三屏
323
+function threeScreen(sd, areaTwoVal) {
324
+	//alert(sd)
325
+	$.ajax({
326
+		type: "get",
327
+		url: huayi.config.callcenter_url + "Info/GetTypeCountNew",
328
+		async: true,
329
+		dataType: 'json',
330
+		data: {
331
+			date: sd,
332
+			branchcode: areaTwoVal
333
+		},
334
+		success: function(data) {
335
+			if (data.state.toLowerCase() == 'success') {
336
+				$('.orderTtype_Con ul').html('');
337
+				// 	   			layer.close(index);
338
+				var newDatas = data.data;
339
+				var con = newDatas.sort(compare("TotalCount"))
340
+				var img_name = '';
341
+				$(con).each(function(i, n) {
342
+					if (n.TypeName.indexOf('咨询') != -1) {
343
+						img_name = 'order_ZX.png'
344
+					}
345
+					if (n.TypeName.indexOf('求助') != -1) {
346
+						img_name = 'order_QZ.png'
347
+					}
348
+					if (n.TypeName.indexOf('投诉') != -1) {
349
+						img_name = 'order_TS.png'
350
+					}
351
+					if (n.TypeName.indexOf('建议') != -1) {
352
+						img_name = 'order_JY.png'
353
+					}
354
+					if (n.TypeName.indexOf('表扬') != -1) {
355
+						img_name = 'order_BY.png'
356
+					}
357
+					if (n.TypeName.indexOf('其他') != -1) {
358
+						img_name = 'order_QT.png'
359
+					}
360
+					$('<li>' +
361
+						'<div class="typeWord">' + n.TypeName + '</div>' +
362
+						'<img src="img/' + img_name + '" alt="" />' +
363
+						'<p class="typeWord_line">数据展示</p>' +
364
+						'<p class="order_count">' + n.DayCount + '</p>' +
365
+						'<p class="typeWord_line">今日' + n.TypeName + '量</p>' +
366
+						'<p class="order_count">' + n.MonthCount + '</p>' +
367
+						'<p class="typeWord_line">本月' + n.TypeName + '量</p>' +
368
+						'<p class="order_count">' + n.TotalCount + '</p>' +
369
+						'<p class="typeWord_line">' + n.TypeName + '总量</p>' +
370
+						'<div class="persent_box">' +
371
+						'<div class="persent_kuang">' + n.Percent + '</div>' +
372
+						'</div>' +
373
+						'<p class="persent_word">总量占比</p>' +
374
+						'</li>').appendTo('.orderTtype_Con ul');
375
+
376
+				})
377
+			}
378
+		}
379
+	});
380
+}
381
+//第五屏js
382
+function fiveScreen(sd, ed, areaTwoVal) {
383
+	//		if(!sd){
384
+	//			sd="2019-11-01"
385
+	//		}if(!ed){
386
+	//			ed="2019-11-30"
387
+	//		}
388
+	keyWord(sd, ed, areaTwoVal);
389
+}
390
+$(".depart").change(function() {
391
+	keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
392
+		' ~ ')[1], $(".areaFive").val());
393
+})
394
+//	第二屏
395
+$(".areaTwo").change(function() {
396
+	var areaTwoVal = $(this).val();
397
+	twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[
398
+		1], areaTwoVal);
399
+	satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(
400
+		' ~ ')[1], areaTwoVal)
401
+});
402
+//第三屏
403
+$(".areaThree").change(function() {
404
+	var areaTwoVal = $(this).val();
405
+	threeScreen($('#time3').val(), areaTwoVal);
406
+});
407
+//第五屏
408
+$(".areaFive").change(function() {
409
+	var areaTwoVal = $(this).val();
410
+	fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
411
+		' ~ ')[1], areaTwoVal);
412
+	deprtment()
413
+});
414
+//部门下拉框
415
+function deprtment() {
416
+	$.getJSON(huayi.config.callcenter_url + "info/GetDeptList", {
417
+			branchcode: $(".areaFive").val()
418
+		},
419
+		function(result) {
420
+			if (result.state.toLowerCase() == "success") {
421
+				goodslist = result.data;
422
+				$(".depart").empty();
423
+				$('<option value="">请选择部门</option>').appendTo($(".depart"));
424
+				$(goodslist).each(function(i, n) {
425
+					$('<option value="' + n.F_DeptId +
426
+						'">' + n.F_DeptName +
427
+						'</option>').appendTo($(".depart"));
428
+				})
429
+			}
430
+		});
431
+}
432
+//区县筛选
433
+//areaSelect ();
434
+function areaSelect() {
435
+	$.getJSON(huayi.config.callcenter_url + "CountyBranch/GetBranchListS", function(result) {
436
+		if (result.state.toLowerCase() == "success") {
437
+			goodslist = result.data;
438
+			//				第五屏
439
+			$(".areaFive").empty();
440
+			$(goodslist).each(function(i, n) {
441
+				$('<option value="' + n.F_Code +
442
+					'">' + n.F_Name +
443
+					'</option>').appendTo($(".areaFive"));
444
+			});
445
+			//第3屏
446
+			$(".areaThree").empty();
447
+			$(goodslist).each(function(i, n) {
448
+				$('<option value="' + n.F_Code +
449
+					'">' + n.F_Name +
450
+					'</option>').appendTo($(".areaThree"));
451
+			});
452
+			//第2屏
453
+			$(".areaTwo").empty();
454
+			$(goodslist).each(function(i, n) {
455
+				$('<option value="' + n.F_Code +
456
+					'">' + n.F_Name +
457
+					'</option>').appendTo($(".areaTwo"));
458
+			});
459
+		}
460
+	});
461
+}
462
+//	左侧关键词
463
+function keyWord(sd, ed, areaTwoVal) {
464
+	$.ajax({
465
+		type: "get",
466
+		url: huayi.config.callcenter_url + "info/GetKeyCountRankByDate",
467
+		async: true,
468
+		dataType: 'json',
469
+		data: {
470
+			start: sd,
471
+			end: ed,
472
+			branchcode: areaTwoVal
473
+		},
474
+		success: function(data) {
475
+			if (data.state.toLowerCase() == 'success') {
476
+				var con = data.data.reverse();
477
+				if (con.length > 0) {
478
+					//						$(".keyW_t").text(con[0].TypeName)
479
+					$('.tagcloud').html('');
480
+					$(con).each(function(k, j) {
481
+						if (k < 19) {
482
+							var strs = '<div index="' + j.Id + '" class="tagcloud_bj">' +
483
+								'<p class="tag_title">' + j.TypeName + '</p>' +
484
+								'<p class="imgs">' + j.Count + '</p>' +
485
+								'</div>'
486
+							$('.tagcloud').append(strs);
487
+						}
488
+					})
489
+					$(".tagcloud div:first-child").removeClass("tagcloud_bj");
490
+					$(".tagcloud div:first-child").addClass("tagcloud_bjShine");
491
+					keyWordDetail(sd, ed, areaTwoVal);
492
+				} else {
493
+					$('.tagcloud').html('');
494
+				}
495
+
496
+			}
497
+		}
498
+	});
499
+}
500
+
501
+//	右侧部门
502
+function keyWordDetail(sd, ed, areaTwoVal) {
503
+	$.ajax({
504
+		type: "get",
505
+		url: huayi.config.callcenter_url + "info/GetDeptKeyCountByDateNew",
506
+		async: true,
507
+		dataType: 'json',
508
+		data: {
509
+			start: sd,
510
+			end: ed,
511
+			branchcode: areaTwoVal,
512
+			deptid: $('.depart').val(),
513
+			keyid: $(".tagcloud_bjShine").eq(0).attr("index")
514
+		},
515
+		success: function(data) {
516
+			if (data.state.toLowerCase() == 'success') {
517
+				$('.scroll_table tbody').html('');
518
+				var con = data.data;
519
+				$(con).each(function(j, n) {
520
+					var rate = '';
521
+					if (n.rate) {
522
+						rate = n.rate;
523
+					}
524
+					var str = '<tr><td>' + n.deptname + '</td><td>' + n.acceptcount + '</td><td>' + rate + '</td></tr>'
525
+					$('.scroll_table tbody').append(str);
526
+				})
527
+				$(".scroll_table").Scroll({
528
+					line: 1,
529
+					speed: 500,
530
+					timer: 2000
531
+				});
532
+			}
533
+		}
534
+	});
535
+}
536
+$(".tagcloud").on("click", "div", function() {
537
+	$(".tagcloud div").addClass("tagcloud_bj");
538
+	$(".tagcloud div").removeClass("tagcloud_bjShine");
539
+	$(this).removeClass("tagcloud_bj");
540
+	$(this).addClass("tagcloud_bjShine");
541
+	keyWordDetail($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(
542
+		' ~ ')[1], $(".areaFive").val());
543
+});
544
+
545
+function Ajax() {
546
+
547
+	oneScreen($('#time1').val() && $('#time1').val().split(' ~ ')[0], $('#time1').val() && $('#time1').val().split(' ~ ')[
548
+		1])
549
+	twoScreen($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(' ~ ')[
550
+		1])
551
+	satisfaction($('#time2').val() && $('#time2').val().split(' ~ ')[0], $('#time2').val() && $('#time2').val().split(
552
+		' ~ ')[1])
553
+	threeScreen($('#time3').val(), $(".areaThree").val());
554
+	fiveScreen($('#test6').val() && $('#test6').val().split(' ~ ')[0], $('#test6').val() && $('#test6').val().split(' ~ ')[
555
+		1], $(".areaFive").val())
556
+
557
+	// //第五 屏  渠道来源
558
+	// var areaOneVal = helper.cookies.get("areaOneVal");
559
+	// var areaOneText = helper.cookies.get("areaOneText");
560
+	// partThree($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(' ~ ')[
561
+	// 	1], areaOneVal)
562
+
563
+
564
+	// // 接单 部门
565
+	// partTwo($('#phone_time').val() && $('#phone_time').val().split(' ~ ')[0], $('#phone_time').val() && $('#phone_time').val()
566
+	// 	.split(' ~ ')[1], areaOneVal);
567
+
568
+	// // 话务数量
569
+	// parthuawu($('#time3').val(), areaOneVal);
570
+
571
+	// // 投诉举报
572
+	// partcomplain($('#time3').val() && $('#time3').val().split(' ~ ')[0], $('#time3').val() && $('#time3').val().split(
573
+	// 	' ~ ')[1], areaOneVal)
574
+
575
+}
576
+
577
+
578
+function loginTimeLimit() {
579
+	$.ajax({
580
+		type: "get",
581
+		url: huayi.config.callcenter_url + "Login/GetAuAuthDate",
582
+		async: false,
583
+		success: function(res) {
584
+			var res = $.parseJSON(res)
585
+			if (res.state == "success") {} else {
586
+				layer.confirm(res.message, {
587
+					icon: 2,
588
+					btn: ['确定'],
589
+					yes: function(index, layero) {
590
+						$("#wrap").hide()
591
+						$(".timeLimit-wrapper").show()
592
+						$(".nav_middle ul a").attr('href', '#')
593
+						layer.close(index)
594
+					},
595
+				});
596
+			}
597
+		}
598
+	});
599
+}

+ 391 - 8
WebChart/js/index.js

@@ -1,7 +1,18 @@
1 1
 
2 2
 var newData=[]  //数据倒序
3 3
 var floag=true
4
-
4
+WEB_SOCKET_SWF_LOCATION = "./js/websocket/WebSocketMain.swf";
5
+	// 开启flash的websocket debug
6
+	WEB_SOCKET_DEBUG = true;
7
+	var ws, n = 0,
8
+		timer;
9
+	var lockReconnect = false; //避免重复连接
10
+	var obj = {};
11
+	var Statess;
12
+	var cls = 0;
13
+	var lasttime = new Date().getTime();
14
+	var cons;
15
+	var person='';
5 16
 // var areaOneVal = helper.cookies.get("areaOneVal");
6 17
 // var areaOneText = helper.cookies.get("areaOneText");
7 18
 // if (areaOneVal) {
@@ -11,8 +22,377 @@ var floag=true
11 22
 // 	var areaOneVal="sqs12345"
12 23
 	
13 24
 // }
14
-$(function() {
25
+//创建scoket连接
26
+	function createWebSocket() {
27
+	    try {
28
+	       
29
+	        Connect();
30
+	    } catch (e) {
31
+	        reconnect();
32
+	    }
33
+	}
34
+	//连接
35
+	function Connect() {
36
+		// debugger
37
+	    ws = new WebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
38
+	    ws.onopen = function () {
39
+	        console.log(new Date() + "    " + "建立连接");
40
+	        //心跳检测重置
41
+	        heartCheck.reset().start();
42
+	        cls = 0;
43
+	        // $(".Login").addClass("active");
44
+	        lasttime = new Date().getTime();
45
+			
46
+	     join()
47
+		 SayBusy()
48
+	        //自动签入
49
+	        // if ($.cookie("socket_state") != null) {
50
+	            // SetLogin($.cookie("socket_state"));
51
+	        // }
52
+	        //$(".hwzt").text('连接成功!');
53
+	    };
54
+	    //接收到消息的回调方法
55
+	    ws.onmessage = function (evt) {
56
+	        //如果获取到消息,心跳检测重置
57
+	        //拿到任何消息都说明当前连接是正常的
58
+	        heartCheck.reset().start();
59
+	        var myDate = new Date();
60
+	        console.log(myDate + "  receive  " + evt.data);
61
+	        var data = JSON.parse(evt.data)[0];
62
+	        if (data) {
63
+	            var rlt = data.Result;
64
+				  var type = data.Type;
65
+	            if (rlt == true) {
66
+	              
67
+	                switch (type.toLowerCase()) {
68
+	                    //case "heart": HeartBack(); break;//心跳
69
+	                    case "login":
70
+	                        LoginBack();
71
+	                        break; //签入
72
+	                  // case "logout":
73
+	                  //     LogoutBack();
74
+	                  //     break; //签出
75
+	                  // case "dropcall":
76
+	                  //     DropCallBack();
77
+	                  //     break; //挂断
78
+	                  case "makecall":
79
+	                      MakeCallBack();
80
+	                      break; //外呼
81
+	                  case "setstate":
82
+	                      SetState(data);
83
+	                      break; //置忙置闲
84
+	                      //case "saybusy": SayBusyBack(data); break;
85
+	                      //case "sayfree": SayFreeBack(data); break;
86
+	                  case "meeting":
87
+	                      MeetingBack();
88
+	                      break; //多方通话
89
+	                  case "transfer":
90
+	                      TransferBack();
91
+	                      break; //转移
92
+	                  case "hold":
93
+	                      HoldBack();
94
+	                      break; //保持
95
+	                  case "retrieve":
96
+	                      RetrieveBack();
97
+	                      break; //接回
98
+	                  // case "incoming":
99
+	                  //     IncomingBack(data);
100
+	                  //     break; //来电
101
+	                  case "subscribe":
102
+	                      SubScribeBack();
103
+	                      break; //监测
104
+	                  case "subscribecancel":
105
+	                      SubScribeCancelBack();
106
+	                      break; //停止监测
107
+	                  case "agentstate":
108
+	                      AgentStateBack(data);
109
+	                      break; //坐席状态
110
+	                  case "linestate":
111
+	                      LineStateBack(data);
112
+	                      break; //线路状态
113
+	                  case "motorsetstate":
114
+	                      SayFreeBack();
115
+	                      break; //班长置闲
116
+	                  // case "linestateagent":
117
+	                  //     LineStateAgentBack(data);
118
+	                  //     break; //线路状态通知
119
+	                  case "agentstateagent":
120
+	                      AgentStateAgentBack(data);
121
+	                      break; //坐席状态通知
122
+	                  //case "callid":
123
+	                  //    CallIDBack(data);
124
+	                  //    break; //获取callid
125
+	                  //case "recordpath":
126
+	                  //    RecordPathBack(data);
127
+	                  //    break; //录音返回
128
+	                  case "getagentlist":
129
+	                      GetAgentListBack(data);
130
+	                      break;//在线坐席信息
131
+	                  case "confirmtransfer":
132
+	                      ConfirmTransfer(data);
133
+	                      break;//确认转移 取消转移
134
+	                  case "consult":
135
+	                      ConsultationCall();
136
+	                      break;//协商呼叫
137
+	                
138
+	                }
139
+	            } else {
140
+	                if (rlt == false) {
141
+	                    //layer.confirm('操作失败!', {
142
+	                    //    btn: ['确定'] 
143
+	                    //});
144
+	                    $(".hwzt").text('操作失败!');
145
+	                } else {
146
+	                    $(".hwzt").text(rlt);
147
+	                    //layer.confirm(rlt, {
148
+	                    //    btn: ['确定']
149
+	                    //});
150
+						  if(type.toLowerCase()=='waitcount') {
151
+							   backstageQueue(data);
152
+							  }
153
+	                }
154
+	            }
155
+	        }
156
+	    };
157
+	    
158
+	    //连接关闭的回调方法
159
+	    ws.onclose = function (evt) {
160
+	        if (cls == 0) {
161
+	            cls = 1;
162
+	            //console.log("连接关闭!");
163
+	            //layer.confirm('连接关闭!', {
164
+	            //    btn: ['确定']
165
+	            //});
166
+	            $(".hwzt").text('连接关闭!');
167
+	            $("#top-search li i").removeClass("active");
168
+	            reconnect();
169
+	        }
170
+	    };
171
+	    //连接发生错误的回调方法
172
+	    ws.onerror = function (evt) {
173
+	        //产生异常
174
+	        $(".hwzt").text('连接出现异常!');
175
+	        console.log(ws);
176
+	        if (ws == null || ws.readyState != ws.OPEN) {
177
+	            console.log(new Date() + "开始重连");
178
+	            reconnect();
179
+	        }
180
+	
181
+	    };
182
+	}
183
+	//重连
184
+	function reconnect() {
185
+		
186
+	    if (lockReconnect) return;
187
+	    lockReconnect = true;
188
+	    //没连接上会一直重连,设置延迟避免请求过多
189
+	    setTimeout(function () {
190
+	        console.log(new Date() + "    " + "重连中……");
191
+	        createWebSocket("ws://" + huayi.config.socket_ip + ":" + huayi.config.socket_port);
192
+	        lockReconnect = false;
193
+			SayBusy()
194
+	    }, 2000);
195
+	}
196
+	
197
+	//发送
198
+	function Send() {
199
+	    if (ws.readyState != ws.OPEN) {
200
+	        reconnect();
201
+	    }
202
+	    if (ws.readyState == ws.OPEN) {
203
+	        console.log(new Date() + "  send  " + JSON.stringify(obj));
204
+	        ws.send(JSON.stringify(obj));
205
+	    }
206
+	}
207
+	//心跳检测
208
+	var heartCheck = {
209
+	    timeout: 25000, //25秒
210
+	    timeoutObj: null,
211
+	    serverTimeoutObj: null,
212
+	    reset: function () {
213
+	        clearTimeout(this.timeoutObj);
214
+	        clearTimeout(this.serverTimeoutObj);
215
+	        return this;
216
+	    },
217
+	    start: function () {
218
+	        var self = this;
219
+	        this.timeoutObj = setTimeout(function () {
220
+	            //这里发送一个心跳,后端收到后,返回一个心跳消息,
221
+	            //onmessage拿到返回的心跳就说明连接正常
222
+	            obj.Type = "Heart";
223
+	            Send();
224
+	            self.serverTimeoutObj = setTimeout(function () { //如果超过一定时间还没重置,说明后端主动断开了
225
+	                ws.close(); //如果onclose会执行reconnect,我们执行ws.close()就行了.如果直接执行reconnect 会触发onclose导致重连两次
226
+	            }, self.timeout)
227
+	        }, this.timeout)
228
+	    }
229
+	}
230
+	// 签入
231
+	function SayBusy() {
232
+		obj.Type = "SayBusy";
233
+		Send();
234
+		console.log('置忙')
235
+	}
236
+	
237
+	//签入
238
+	function LoginBack() {
239
+	    
240
+	  obj.Type = "SayBusy";
241
+	  Send();
242
+	  console.log('置忙')
243
+	}
244
+	// 点击签入
245
+	function join(){
246
+	            obj.Type ='Login',
247
+		        obj.AgentID='9898',
248
+		        obj.AgentExten='1015',
249
+		        obj.AgentType='0',
250
+				obj.AgentGroup='364'
251
+		       
252
+		      
253
+			  // console.log(scoketDatas)
254
+		      Send()
255
+	}
256
+	//监测
257
+	function SubScribeBack() {
258
+	    var obj = $("iframe:visible")
259
+	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
260
+	        window.frames[obj.attr("name")].Start();
261
+	    }
262
+	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
263
+	        window.frames[obj.attr("name")].Start();
264
+	    }
265
+	}
266
+	//取消监测
267
+	function SubScribeCancelBack() {
268
+	    // var obj = $("iframe:visible")
269
+	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
270
+	    //     window.frames[obj.attr("name")].Stop();
271
+	    // }
272
+	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
273
+	    //     window.frames[obj.attr("name")].Stop();
274
+	    // }
275
+		$('.yuan_one').addClass("lx")
276
+		$('.yuan_two').addClass("lx")
277
+	}
278
+	//班长监测返回状态
279
+	//坐席状态
280
+	
281
+	function AgentStateBack(data) {
282
+		$('.yuan_one').removeClass("lx")
283
+		$('.yuan_two').removeClass("lx")
284
+		$(cons).each(function (i, n) {
285
+			if(n.F_UserCode==data.AgentID){
286
+				if(data.State=='0'){
287
+					$('.yuan_one').eq(i).addClass("lx")
288
+					$('.yuan_two').eq(i).addClass("lx")
289
+				}else if(data.State=='2'){
290
+					$('.yuan_one').eq(i).addClass("kx")
291
+					$('.yuan_two').eq(i).addClass("kx")
292
+				}else if(data.State=='3'){
293
+					$('.yuan_one').eq(i).addClass("hc")
294
+					$('.yuan_two').eq(i).addClass("hc")
295
+				}else if(data.State=='4'){
296
+					$('.yuan_one').eq(i).addClass("hh")
297
+					$('.yuan_two').eq(i).addClass("hh")
298
+				}else if(data.State=='5'){
299
+					$('.yuan_one').eq(i).addClass("ml")
300
+					$('.yuan_two').eq(i).addClass("ml")
301
+				}else if(data.State=='6'){
302
+					$('.yuan_one').eq(i).addClass("zl")
303
+					$('.yuan_two').eq(i).addClass("zl")
304
+				}
305
+				
306
+			}
307
+			})
308
+	    // var obj = $("iframe:visible")
309
+	    // if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
310
+	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
311
+	    // }
312
+	    // if (obj.attr("data-id") == "./TelCall/zxKong.html") {
313
+	    //     window.frames[obj.attr("name")].UpdateAgentState(data.AgentID, data.State);
314
+	    // }
315
+	}
316
+	//线路状态
317
+	function LineStateBack(data) {
318
+	    var obj = $("iframe:visible")
319
+	    if (obj.attr("data-id") == "./TelCall/SeatMonitor.html") {
320
+	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
321
+	    }
322
+	    if (obj.attr("data-id") == "./TelCall/zxKong.html") {
323
+	        window.frames[obj.attr("name")].UpdateLineState(data.AgentID, data.State);
324
+	    }
325
+	}
326
+	//后台排队
327
+	function backstageQueue(data) {
328
+		
329
+		person=data.WaitCount
330
+		console.log(person)
331
+	    // if (obj.attr("data-id") == "./widgets.html") {
332
+	    //     window.frames[obj.attr("name")].realTimeMonitorQueue(data.WaitCount);
333
+	    // }
334
+	}
335
+	//坐席状态通知
336
+	function AgentStateAgentBack(data) {
337
+	    var strr = '';
338
+	    console.log('坐席状态'+ data.State );
339
+	    switch (data.State+"") {
340
+	        case "0":
341
+	            strr = "离线";
342
+	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
343
+	            break; //离线
344
+	        case "1":
345
+	            break; //登录中
346
+	        case "2":
347
+	            strr = "空闲";
348
+	            $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
349
+	            break; //空闲
350
+	        case "3":
351
+	            strr = "通话中";
352
+	            $(".zxzt").removeClass("bl").removeClass("by").addClass("br");
353
+	            break; //通话中
354
+	        case "4":
355
+	            strr = "话后处理中";
356
+	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
357
+	            break; //话后处理中
358
+	        case "5":
359
+	            strr = "忙碌";
360
+	            $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
361
+	            break; //小休
362
+	        case "6":
363
+	            strr = "振铃";
364
+	            break; //被请求
365
+	        case "7":
366
+	            strr = "注销";
367
+	            $(".zxzt").removeClass("br").removeClass("bl").removeClass("by");
368
+	            break; //注销
369
+	    }
370
+	
371
+	    $(".hxzt").text(strr);
372
+	}
15 373
 	
374
+	//置忙 置闲
375
+	function SetState(obj) {
376
+	    if (obj.State == '5') {
377
+	        $(".SayBusy").removeClass("active");
378
+	        $(".SayFree").addClass("active");
379
+	        $(".zxzt").removeClass("bl").removeClass("br").addClass("by");
380
+	        $(".hwzt").text('忙碌');
381
+	        $("#isml").val(1);
382
+	        // SetStateCookie(1);
383
+	    }
384
+	    if (obj.State == '2') {
385
+	    	$(".SayBusy").addClass("active");
386
+	        $(".SayFree").removeClass("active");
387
+	        $(".zxzt").removeClass("br").removeClass("by").addClass("bl");
388
+	        $(".hwzt").text('空闲');
389
+	        $("#isml").val(0);
390
+	        // SetStateCookie(0);
391
+	    }
392
+	}
393
+$(function() {
394
+	createWebSocket()
395
+	 SayBusy()
16 396
 	loginTimeLimit(); //登录
17 397
 
18 398
 	var mySwiper = new Swiper('.swiper-container', {
@@ -232,9 +612,11 @@ function turn(aa) {
232 612
 					if(floag==true){
233 613
 						$("#det_ult").html('')
234 614
 						$(newData).each(function(i, n) {
235
-						var str=' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>'+n.AreaName+'</span><span class="AY_num">'+n.SLCount+'</span></p></li>';
236
-						    var a=$(str)
237
-						    a.appendTo($("#det_ult"))
615
+						if(i<10){
616
+							var str=' <li class="orderli"><img src="img/num_icon.png" alt="" /><p class="num_word"><span>'+n.AreaName+'</span><span class="AY_num">'+n.SLCount+'</span></p></li>';
617
+							    var a=$(str)
618
+							    a.appendTo($("#det_ult"))
619
+						}
238 620
 								   })
239 621
 									   floag=false
240 622
 					}
@@ -785,7 +1167,7 @@ function partTwo(starts, ends, areaOneVal) {
785 1167
 
786 1168
 		xAxis: {
787 1169
 			name: '类型',
788
-			data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)"],
1170
+			data: ["话务量(通)", "来电(通)", "接通量(通)", "平均通话时长(秒)","排队人数"],
789 1171
 			axisLine: {
790 1172
 				lineStyle: {
791 1173
 					color: '#3061a2'
@@ -829,7 +1211,7 @@ function partTwo(starts, ends, areaOneVal) {
829 1211
 					color: function(params) {
830 1212
 						// build a color map as your need.
831 1213
 						var colorList = [
832
-							'#368cab', '#54b793', '#4b6ab0', '#2531a9'
1214
+							'#368cab', '#54b793', '#4b6ab0', '#2531a9','#a93d19'
833 1215
 						];
834 1216
 						return colorList[params.dataIndex]
835 1217
 					}
@@ -864,9 +1246,10 @@ function partTwo(starts, ends, areaOneVal) {
864 1246
 				if(data.state.toLowerCase() == "success") {
865 1247
 					//					layer.close(index);
866 1248
 					var con = data.data;
1249
+					con.person=person
867 1250
 					todyPhoneCount.setOption({
868 1251
 						series: [{
869
-							data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes]
1252
+							data: [con.hwcon, con.lhcon, con.jtcon, con.pjthtimes,con.person]
870 1253
 						}]
871 1254
 
872 1255
 					})

+ 15 - 15
WebChart/js/map1.js

@@ -24,7 +24,7 @@ window.onload = function() {
24 24
 	});
25 25
 	
26 26
 	$("#myMap").bind("contextmenu", function () {
27
-	    //alert("点击了右键");
27
+	    //alert("点击了右键"); 
28 28
 	    $(".map_bg").fadeIn();
29 29
 	    $("#mapSj").hide();
30 30
 	    //return false;
@@ -44,7 +44,7 @@ window.onload = function() {
44 44
 		myGeo.getPoint(address, function(point) {
45 45
 			if(point) {
46 46
 				//定位到区 ,级别显示12
47
-				map.centerAndZoom(point, 12);
47
+				map.centerAndZoom(point, 13);
48 48
 				map.enableScrollWheelZoom(true); //开启鼠标滚轮缩放
49 49
 				//删除选点
50 50
 				map.clearOverlays();
@@ -126,7 +126,7 @@ window.onload = function() {
126 126
 			myGeo.getPoint(address, function(point) {
127 127
 				if(point) {
128 128
 					//定位到区 ,级别显示12
129
-					map.centerAndZoom(point, 12);
129
+					map.centerAndZoom(point, 13);
130 130
 					//删除选点
131 131
 					map.clearOverlays();
132 132
 					throungh();
@@ -248,28 +248,28 @@ window.onload = function() {
248 248
 				map.setZoom(18);
249 249
 			}
250 250
 			//解析地址
251
-			// var rsaddress = rs.address;
252
-			// console.log(rs);
253
-			// console.log(rs.addressComponents.district)
254
-			// if (rs.addressComponents.district=="睢阳区") {
251
+			var rsaddress = rs.address;
252
+			console.log(rs);
253
+			console.log(rs.addressComponents.district)
254
+			// if (rs.addressComponents.district=="汤阴县") {
255 255
 			// 	$('#sourcearea').val("2");
256
-			// }else if (rs.addressComponents.district=="梁园区"){
256
+			// }else if (rs.addressComponents.district=="龙安区"){
257 257
 			// 	$('#sourcearea').val("3");
258
-			// }else if (rs.addressComponents.district=="永城市"){
258
+			// }else if (rs.addressComponents.district=="滑县"){
259 259
 			// 	$('#sourcearea').val("4");
260
-			// }else if (rs.addressComponents.district=="民权县"){
260
+			// }else if (rs.addressComponents.district=="北关区"){
261 261
 			// 	$('#sourcearea').val("5");
262 262
 			// }else if (rs.addressComponents.district=="林州市"){
263 263
 			// 	$('#sourcearea').val("6");
264
-			// }else if (rs.addressComponents.district=="宁陵县"){
264
+			// }else if (rs.addressComponents.district=="殷都区"){
265 265
 			// 	$('#sourcearea').val("7");
266
-			// }else if (rs.addressComponents.district=="柘城县"){
266
+			// }else if (rs.addressComponents.district=="高新区"){
267 267
 			// 	$('#sourcearea').val("8");
268
-			// }else if (rs.addressComponents.district=="虞城县"){
268
+			// }else if (rs.addressComponents.district=="安阳县"){
269 269
 			// 	$('#sourcearea').val("9");
270
-			// }else if (rs.addressComponents.district=="夏邑县"){
270
+			// }else if (rs.addressComponents.district=="内黄县"){
271 271
 			// 	$('#sourcearea').val("10");
272
-			// }else if (rs.addressComponents.district=="城乡一体化示范区"){
272
+			// }else if (rs.addressComponents.district=="文峰区"){
273 273
 			// 	$('#sourcearea').val("11");
274 274
 			// }
275 275
 			$('#sourcearea').find("option:selected").text(rs.addressComponents.district);

binární
WebChart/js/websocket/WebSocketMain.swf


File diff suppressed because it is too large
+ 4 - 0
WebChart/js/websocket/swfobject.js


+ 398 - 0
WebChart/js/websocket/web_socket.js

@@ -0,0 +1,398 @@
1
+// Copyright: Hiroshi Ichikawa <http://gimite.net/en/>
2
+// License: New BSD License
3
+// Reference: http://dev.w3.org/html5/websockets/
4
+// Reference: http://tools.ietf.org/html/rfc6455
5
+
6
+(function() {
7
+  
8
+  if (window.WEB_SOCKET_FORCE_FLASH) {
9
+    // Keeps going.
10
+  } else if (window.WebSocket) {
11
+    return;
12
+  } else if (window.MozWebSocket) {
13
+    // Firefox.
14
+    window.WebSocket = MozWebSocket;
15
+    return;
16
+  }
17
+  
18
+  var logger;
19
+  if (window.WEB_SOCKET_LOGGER) {
20
+    logger = WEB_SOCKET_LOGGER;
21
+  } else if (window.console && window.console.log && window.console.error) {
22
+    // In some environment, console is defined but console.log or console.error is missing.
23
+    logger = window.console;
24
+  } else {
25
+    logger = {log: function(){ }, error: function(){ }};
26
+  }
27
+  
28
+  // swfobject.hasFlashPlayerVersion("10.0.0") doesn't work with Gnash.
29
+  if (swfobject.getFlashPlayerVersion().major < 10) {
30
+    logger.error("Flash Player >= 10.0.0 is required.");
31
+    return;
32
+  }
33
+  if (location.protocol == "file:") {
34
+    logger.error(
35
+      "WARNING: web-socket-js doesn't work in file:///... URL " +
36
+      "unless you set Flash Security Settings properly. " +
37
+      "Open the page via Web server i.e. http://...");
38
+  }
39
+
40
+  /**
41
+   * Our own implementation of WebSocket class using Flash.
42
+   * @param {string} url
43
+   * @param {array or string} protocols
44
+   * @param {string} proxyHost
45
+   * @param {int} proxyPort
46
+   * @param {string} headers
47
+   */
48
+  window.WebSocket = function(url, protocols, proxyHost, proxyPort, headers) {
49
+    var self = this;
50
+    self.__id = WebSocket.__nextId++;
51
+    WebSocket.__instances[self.__id] = self;
52
+    self.readyState = WebSocket.CONNECTING;
53
+    self.bufferedAmount = 0;
54
+    self.__events = {};
55
+    if (!protocols) {
56
+      protocols = [];
57
+    } else if (typeof protocols == "string") {
58
+      protocols = [protocols];
59
+    }
60
+    // Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc.
61
+    // Otherwise, when onopen fires immediately, onopen is called before it is set.
62
+    self.__createTask = setTimeout(function() {
63
+      WebSocket.__addTask(function() {
64
+        self.__createTask = null;
65
+        WebSocket.__flash.create(
66
+            self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null);
67
+      });
68
+    }, 0);
69
+  };
70
+
71
+  /**
72
+   * Send data to the web socket.
73
+   * @param {string} data  The data to send to the socket.
74
+   * @return {boolean}  True for success, false for failure.
75
+   */
76
+  WebSocket.prototype.send = function(data) {
77
+    if (this.readyState == WebSocket.CONNECTING) {
78
+      throw "INVALID_STATE_ERR: Web Socket connection has not been established";
79
+    }
80
+    // We use encodeURIComponent() here, because FABridge doesn't work if
81
+    // the argument includes some characters. We don't use escape() here
82
+    // because of this:
83
+    // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Functions#escape_and_unescape_Functions
84
+    // But it looks decodeURIComponent(encodeURIComponent(s)) doesn't
85
+    // preserve all Unicode characters either e.g. "\uffff" in Firefox.
86
+    // Note by wtritch: Hopefully this will not be necessary using ExternalInterface.  Will require
87
+    // additional testing.
88
+    var result = WebSocket.__flash.send(this.__id, encodeURIComponent(data));
89
+    if (result < 0) { // success
90
+      return true;
91
+    } else {
92
+      this.bufferedAmount += result;
93
+      return false;
94
+    }
95
+  };
96
+
97
+  /**
98
+   * Close this web socket gracefully.
99
+   */
100
+  WebSocket.prototype.close = function() {
101
+    if (this.__createTask) {
102
+      clearTimeout(this.__createTask);
103
+      this.__createTask = null;
104
+      this.readyState = WebSocket.CLOSED;
105
+      return;
106
+    }
107
+    if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) {
108
+      return;
109
+    }
110
+    this.readyState = WebSocket.CLOSING;
111
+    WebSocket.__flash.close(this.__id);
112
+  };
113
+
114
+  /**
115
+   * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>}
116
+   *
117
+   * @param {string} type
118
+   * @param {function} listener
119
+   * @param {boolean} useCapture
120
+   * @return void
121
+   */
122
+  WebSocket.prototype.addEventListener = function(type, listener, useCapture) {
123
+    if (!(type in this.__events)) {
124
+      this.__events[type] = [];
125
+    }
126
+    this.__events[type].push(listener);
127
+  };
128
+
129
+  /**
130
+   * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>}
131
+   *
132
+   * @param {string} type
133
+   * @param {function} listener
134
+   * @param {boolean} useCapture
135
+   * @return void
136
+   */
137
+  WebSocket.prototype.removeEventListener = function(type, listener, useCapture) {
138
+    if (!(type in this.__events)) return;
139
+    var events = this.__events[type];
140
+    for (var i = events.length - 1; i >= 0; --i) {
141
+      if (events[i] === listener) {
142
+        events.splice(i, 1);
143
+        break;
144
+      }
145
+    }
146
+  };
147
+
148
+  /**
149
+   * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>}
150
+   *
151
+   * @param {Event} event
152
+   * @return void
153
+   */
154
+  WebSocket.prototype.dispatchEvent = function(event) {
155
+    var events = this.__events[event.type] || [];
156
+    for (var i = 0; i < events.length; ++i) {
157
+      events[i](event);
158
+    }
159
+    var handler = this["on" + event.type];
160
+    if (handler) handler.apply(this, [event]);
161
+  };
162
+
163
+  /**
164
+   * Handles an event from Flash.
165
+   * @param {Object} flashEvent
166
+   */
167
+  WebSocket.prototype.__handleEvent = function(flashEvent) {
168
+    
169
+    if ("readyState" in flashEvent) {
170
+      this.readyState = flashEvent.readyState;
171
+    }
172
+    if ("protocol" in flashEvent) {
173
+      this.protocol = flashEvent.protocol;
174
+    }
175
+    
176
+    var jsEvent;
177
+    if (flashEvent.type == "open" || flashEvent.type == "error") {
178
+      jsEvent = this.__createSimpleEvent(flashEvent.type);
179
+    } else if (flashEvent.type == "close") {
180
+      jsEvent = this.__createSimpleEvent("close");
181
+      jsEvent.wasClean = flashEvent.wasClean ? true : false;
182
+      jsEvent.code = flashEvent.code;
183
+      jsEvent.reason = flashEvent.reason;
184
+    } else if (flashEvent.type == "message") {
185
+      var data = decodeURIComponent(flashEvent.message);
186
+      jsEvent = this.__createMessageEvent("message", data);
187
+    } else {
188
+      throw "unknown event type: " + flashEvent.type;
189
+    }
190
+    
191
+    this.dispatchEvent(jsEvent);
192
+    
193
+  };
194
+  
195
+  WebSocket.prototype.__createSimpleEvent = function(type) {
196
+    if (document.createEvent && window.Event) {
197
+      var event = document.createEvent("Event");
198
+      event.initEvent(type, false, false);
199
+      return event;
200
+    } else {
201
+      return {type: type, bubbles: false, cancelable: false};
202
+    }
203
+  };
204
+  
205
+  WebSocket.prototype.__createMessageEvent = function(type, data) {
206
+    if (window.MessageEvent && typeof(MessageEvent) == "function" && !window.opera) {
207
+      return new MessageEvent("message", {
208
+        "view": window,
209
+        "bubbles": false,
210
+        "cancelable": false,
211
+        "data": data
212
+      });
213
+    } else if (document.createEvent && window.MessageEvent && !window.opera) {
214
+      var event = document.createEvent("MessageEvent");
215
+    	event.initMessageEvent("message", false, false, data, null, null, window, null);
216
+      return event;
217
+    } else {
218
+      // Old IE and Opera, the latter one truncates the data parameter after any 0x00 bytes.
219
+      return {type: type, data: data, bubbles: false, cancelable: false};
220
+    }
221
+  };
222
+  
223
+  /**
224
+   * Define the WebSocket readyState enumeration.
225
+   */
226
+  WebSocket.CONNECTING = 0;
227
+  WebSocket.OPEN = 1;
228
+  WebSocket.CLOSING = 2;
229
+  WebSocket.CLOSED = 3;
230
+
231
+  // Field to check implementation of WebSocket.
232
+  WebSocket.__isFlashImplementation = true;
233
+  WebSocket.__initialized = false;
234
+  WebSocket.__flash = null;
235
+  WebSocket.__instances = {};
236
+  WebSocket.__tasks = [];
237
+  WebSocket.__nextId = 0;
238
+  
239
+  /**
240
+   * Load a new flash security policy file.
241
+   * @param {string} url
242
+   */
243
+  WebSocket.loadFlashPolicyFile = function(url){
244
+    WebSocket.__addTask(function() {
245
+      WebSocket.__flash.loadManualPolicyFile(url);
246
+    });
247
+  };
248
+
249
+  /**
250
+   * Loads WebSocketMain.swf and creates WebSocketMain object in Flash.
251
+   */
252
+  WebSocket.__initialize = function() {
253
+    
254
+    if (WebSocket.__initialized) return;
255
+    WebSocket.__initialized = true;
256
+    
257
+    if (WebSocket.__swfLocation) {
258
+      // For backword compatibility.
259
+      window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation;
260
+    }
261
+    if (!window.WEB_SOCKET_SWF_LOCATION) {
262
+      logger.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf");
263
+      return;
264
+    }
265
+    if (!window.WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR &&
266
+        !WEB_SOCKET_SWF_LOCATION.match(/(^|\/)WebSocketMainInsecure\.swf(\?.*)?$/) &&
267
+        WEB_SOCKET_SWF_LOCATION.match(/^\w+:\/\/([^\/]+)/)) {
268
+      var swfHost = RegExp.$1;
269
+      if (location.host != swfHost) {
270
+        logger.error(
271
+            "[WebSocket] You must host HTML and WebSocketMain.swf in the same host " +
272
+            "('" + location.host + "' != '" + swfHost + "'). " +
273
+            "See also 'How to host HTML file and SWF file in different domains' section " +
274
+            "in README.md. If you use WebSocketMainInsecure.swf, you can suppress this message " +
275
+            "by WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR = true;");
276
+      }
277
+    }
278
+    var container = document.createElement("div");
279
+    container.id = "webSocketContainer";
280
+    // Hides Flash box. We cannot use display: none or visibility: hidden because it prevents
281
+    // Flash from loading at least in IE. So we move it out of the screen at (-100, -100).
282
+    // But this even doesn't work with Flash Lite (e.g. in Droid Incredible). So with Flash
283
+    // Lite, we put it at (0, 0). This shows 1x1 box visible at left-top corner but this is
284
+    // the best we can do as far as we know now.
285
+    container.style.position = "absolute";
286
+    if (WebSocket.__isFlashLite()) {
287
+      container.style.left = "0px";
288
+      container.style.top = "0px";
289
+    } else {
290
+      container.style.left = "-100px";
291
+      container.style.top = "-100px";
292
+    }
293
+    var holder = document.createElement("div");
294
+    holder.id = "webSocketFlash";
295
+    container.appendChild(holder);
296
+    document.body.appendChild(container);
297
+    // See this article for hasPriority:
298
+    // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html
299
+    swfobject.embedSWF(
300
+      WEB_SOCKET_SWF_LOCATION,
301
+      "webSocketFlash",
302
+      "1" /* width */,
303
+      "1" /* height */,
304
+      "10.0.0" /* SWF version */,
305
+      null,
306
+      null,
307
+      {hasPriority: true, swliveconnect : true, allowScriptAccess: "always"},
308
+      null,
309
+      function(e) {
310
+        if (!e.success) {
311
+          logger.error("[WebSocket] swfobject.embedSWF failed");
312
+        }
313
+      }
314
+    );
315
+    
316
+  };
317
+  
318
+  /**
319
+   * Called by Flash to notify JS that it's fully loaded and ready
320
+   * for communication.
321
+   */
322
+  WebSocket.__onFlashInitialized = function() {
323
+    // We need to set a timeout here to avoid round-trip calls
324
+    // to flash during the initialization process.
325
+    setTimeout(function() {
326
+      WebSocket.__flash = document.getElementById("webSocketFlash");
327
+      WebSocket.__flash.setCallerUrl(location.href);
328
+      WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
329
+      for (var i = 0; i < WebSocket.__tasks.length; ++i) {
330
+        WebSocket.__tasks[i]();
331
+      }
332
+      WebSocket.__tasks = [];
333
+    }, 0);
334
+  };
335
+  
336
+  /**
337
+   * Called by Flash to notify WebSockets events are fired.
338
+   */
339
+  WebSocket.__onFlashEvent = function() {
340
+    setTimeout(function() {
341
+      try {
342
+        // Gets events using receiveEvents() instead of getting it from event object
343
+        // of Flash event. This is to make sure to keep message order.
344
+        // It seems sometimes Flash events don't arrive in the same order as they are sent.
345
+        var events = WebSocket.__flash.receiveEvents();
346
+        for (var i = 0; i < events.length; ++i) {
347
+          WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i]);
348
+        }
349
+      } catch (e) {
350
+        logger.error(e);
351
+      }
352
+    }, 0);
353
+    return true;
354
+  };
355
+  
356
+  // Called by Flash.
357
+  WebSocket.__log = function(message) {
358
+    logger.log(decodeURIComponent(message));
359
+  };
360
+  
361
+  // Called by Flash.
362
+  WebSocket.__error = function(message) {
363
+    logger.error(decodeURIComponent(message));
364
+  };
365
+  
366
+  WebSocket.__addTask = function(task) {
367
+    if (WebSocket.__flash) {
368
+      task();
369
+    } else {
370
+      WebSocket.__tasks.push(task);
371
+    }
372
+  };
373
+  
374
+  /**
375
+   * Test if the browser is running flash lite.
376
+   * @return {boolean} True if flash lite is running, false otherwise.
377
+   */
378
+  WebSocket.__isFlashLite = function() {
379
+    if (!window.navigator || !window.navigator.mimeTypes) {
380
+      return false;
381
+    }
382
+    var mimeType = window.navigator.mimeTypes["application/x-shockwave-flash"];
383
+    if (!mimeType || !mimeType.enabledPlugin || !mimeType.enabledPlugin.filename) {
384
+      return false;
385
+    }
386
+    return mimeType.enabledPlugin.filename.match(/flashlite/i) ? true : false;
387
+  };
388
+  
389
+  if (!window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION) {
390
+    // NOTE:
391
+    //   This fires immediately if web_socket.js is dynamically loaded after
392
+    //   the document is loaded.
393
+    swfobject.addDomLoadEvent(function() {
394
+      WebSocket.__initialize();
395
+    });
396
+  }
397
+  
398
+})();