地铁二期项目正式开始

MainScreen.cshtml 71KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <title>数据</title>
  7. <meta name="description" content="">
  8. <meta name="keywords" content="">
  9. <link rel="stylesheet" href="~/Content/css/screendisplay/swiper.min.css">
  10. <link href="~/Content/css/screendisplay/style.css" rel="stylesheet" />
  11. <!-- Link Swiper's CSS -->
  12. <style>
  13. .swiper-container {
  14. padding-bottom: 5%;
  15. opacity: 0;
  16. transform: scale(0.5);
  17. -ms-transform: scale(0.5); /* IE 9 */
  18. -webkit-transform: scale(0.5); /* Safari 和 Chrome */
  19. -o-transform: scale(0.5); /* Opera */
  20. -moz-transform: scale(0.5);
  21. }
  22. .active .swiper-container {
  23. opacity: 1;
  24. transform: scale(1);
  25. -ms-transform: scale(1); /* IE 9 */
  26. -webkit-transform: scale(1); /* Safari 和 Chrome */
  27. -o-transform: scale(1); /* Opera */
  28. -moz-transform: scale(1);
  29. transition: all 0.8s;
  30. -moz-transition: all 0.8s; /* Firefox 4 */
  31. -webkit-transition: all 0.8s; /* Safari 和 Chrome */
  32. -o-transition: all 0.8s;
  33. }
  34. .swiper-slide {
  35. background-position: center;
  36. background-size: cover;
  37. width: 46%;
  38. height: 20.4vw;
  39. opacity: 0.5;
  40. }
  41. .swiper-slide-active {
  42. opacity: 1;
  43. }
  44. .swiper-slide img {
  45. display: block;
  46. width: 88%;
  47. margin: 0 auto;
  48. height: 15.5vw;
  49. }
  50. .swiper-pagination-bullet {
  51. width: 2vw;
  52. height: 2vw;
  53. text-align: center;
  54. line-height: 2vw;
  55. font-size: 18px;
  56. color: #519fed;
  57. opacity: 1;
  58. border: 1px solid #519fed;
  59. background: rgba(255, 255, 255, 0.01);
  60. }
  61. .swiper-pagination-bullet-active {
  62. width: 2.4vw;
  63. height: 2.4vw;
  64. line-height: 2.4vw;
  65. color: #4bb7e9;
  66. border: 2px solid #4bb7e9;
  67. background: rgba(255, 255, 255, 0.01);
  68. }
  69. .swiper-slide {
  70. background: url("/Content/images/screendisplay/slider_bg.png") no-repeat;
  71. background-size: 100% 100%;
  72. }
  73. </style>
  74. <script src="/Content/js/jquery-1.8.3.min.js"></script>
  75. <script src="/Content/dist/echarts.js" type="text/javascript"></script>
  76. <script src="/Content/dist/theme/dahua.js" type="text/javascript"></script>
  77. <script src="/Content/js/Report/GetDate.js"></script>
  78. <script type="text/javascript">
  79. // 路径配置
  80. require.config({
  81. paths: {
  82. echarts: '/Content/dist'
  83. }
  84. });
  85. //获取坐席话务量报表
  86. function InitUserCallMonth(thisYear, thisMonth, ThisDateDept) {
  87. var thisTittle = thisYear + '年' + thisMonth + '月坐席话务量报表';
  88. $(".zxhwl").html(thisTittle);
  89. var bottom, dataModel;
  90. $.ajax({
  91. url: "/Report/CallTimeMathChartData",
  92. type: "get",
  93. contentType: "application/json",
  94. dataType: "text",
  95. cache: false,
  96. data: {
  97. NowDateTime: new Date(), dateParty: ThisDateDept
  98. },
  99. success: function (result, status) {
  100. if (status) {
  101. dataModel = JSON.parse(result);
  102. bottom = dataModel.bottom;
  103. // 使用
  104. require(
  105. [
  106. 'echarts',
  107. 'echarts/chart/bar' // 使用柱状图就加载bar模块,按需加载
  108. , 'echarts/chart/line' // 使用柱状图就加载bar模块,按需加载
  109. ],
  110. function (ec) {
  111. var dahuatheme
  112. require(['echarts/theme/dahua'], function (theme) {
  113. dahuatheme = theme;
  114. });
  115. // 基于准备好的dom,初始化echarts图表
  116. var myChart = ec.init(document.getElementById('callMonth'), dahuatheme);
  117. option = {
  118. title: {
  119. show: false,
  120. text: '',
  121. subtext: ''
  122. },
  123. tooltip: {
  124. trigger: 'axis'
  125. },
  126. legend: {
  127. textStyle: {
  128. color: '#fff' // 图例文字颜色
  129. },
  130. data: ['总通话次数', '接听电话次数', '呼出电话次数', '通话总时长', '平均通话时长']
  131. },
  132. toolbox: {
  133. show: false,
  134. feature: {
  135. dataView: { show: true, readOnly: false },
  136. magicType: { show: true, type: ['line', 'bar'] },
  137. restore: { show: true },
  138. saveAsImage: { show: true }
  139. }
  140. },
  141. calculable: true,
  142. xAxis: [
  143. {
  144. type: 'category',
  145. axisLabel: {
  146. interval: 0,
  147. textStyle: {
  148. color: '#fff'
  149. }
  150. },
  151. data: eval(bottom)
  152. }
  153. ],
  154. yAxis: [
  155. {
  156. type: 'value',
  157. axisLabel: {
  158. interval: 0,
  159. textStyle: {
  160. color: '#fff'
  161. }
  162. }
  163. }
  164. ],
  165. series: [
  166. {
  167. name: '总通话次数',
  168. type: 'line',
  169. data: eval(dataModel.d1),
  170. markPoint: {
  171. data: [
  172. { type: 'max', name: '最大值' },
  173. { type: 'min', name: '最小值' }
  174. ]
  175. }
  176. },
  177. {
  178. name: '接听电话次数',
  179. type: 'line',
  180. data: eval(dataModel.d2),
  181. markPoint: {
  182. data: [
  183. { type: 'max', name: '最大值' },
  184. { type: 'min', name: '最小值' }
  185. ]
  186. }
  187. },
  188. {
  189. name: '呼出电话次数',
  190. type: 'line',
  191. data: eval(dataModel.d3),
  192. markPoint: {
  193. data: [
  194. { type: 'max', name: '最大值' },
  195. { type: 'min', name: '最小值' }
  196. ]
  197. }
  198. },
  199. {
  200. name: '通话总时长',
  201. type: 'line',
  202. data: eval(dataModel.d4),
  203. markPoint: {
  204. data: [
  205. { type: 'max', name: '最大值' },
  206. { type: 'min', name: '最小值' }
  207. ]
  208. }
  209. },
  210. {
  211. name: '平均通话时长',
  212. type: 'line',
  213. data: eval(dataModel.d5),
  214. markPoint: {
  215. data: [
  216. { type: 'max', name: '最大值' },
  217. { type: 'min', name: '最小值' }
  218. ]
  219. }
  220. }
  221. ]
  222. };
  223. // 为echarts对象加载数据
  224. myChart.setOption(option);
  225. }
  226. );
  227. }
  228. }
  229. });
  230. }
  231. //获取坐席业务量报表
  232. function InitUserBussMonth(thisYear, thisMonth, ThisDateDept) {
  233. var thisTittle = thisYear + '年' + thisMonth + '月坐席业务量报表';
  234. $(".zxywl").html(thisTittle);
  235. var bottom, d1, d2, d3, d4, d5;
  236. $.ajax({
  237. url: "/Report/WorkOrderTypeUserMathChartData",
  238. type: "get",
  239. contentType: "application/json",
  240. dataType: "text",
  241. cache: false,
  242. data: {
  243. NowDateTime: new Date(), dateParty: ThisDateDept
  244. },
  245. success: function (result, status) {
  246. if (status) {
  247. var dataModel = JSON.parse(result);
  248. bottom = dataModel.bottom;
  249. d1 = dataModel.d1;
  250. d2 = dataModel.d2;
  251. d3 = dataModel.d3;
  252. d4 = dataModel.d4;
  253. d5 = dataModel.d5;
  254. // 使用
  255. require(
  256. [
  257. 'echarts',
  258. 'echarts/chart/bar' // 使用柱状图就加载bar模块,按需加载
  259. , 'echarts/chart/line' // 使用柱状图就加载bar模块,按需加载
  260. ],
  261. function (ec) {
  262. var dahuatheme
  263. require(['echarts/theme/dahua'], function (theme) {
  264. dahuatheme = theme;
  265. });
  266. // 基于准备好的dom,初始化echarts图表
  267. var myChart = ec.init(document.getElementById('bussMonth'), dahuatheme);
  268. option = {
  269. title: {
  270. show: false,
  271. text: '',
  272. subtext: ''
  273. },
  274. tooltip: {
  275. trigger: 'axis'
  276. },
  277. legend: {
  278. textStyle: {
  279. color: '#fff' // 图例文字颜色
  280. },
  281. data: ['业务数量', '语音业务数量', '在线业务数量', '微信业务数量', '微博业务数量']
  282. },
  283. toolbox: {
  284. show: false,
  285. feature: {
  286. dataView: { show: true, readOnly: false },
  287. magicType: { show: true, type: ['line', 'bar'] },
  288. restore: { show: true },
  289. saveAsImage: { show: true }
  290. }
  291. },
  292. calculable: true,
  293. xAxis: [
  294. {
  295. type: 'category',
  296. axisLabel: {
  297. interval: 0,
  298. textStyle: {
  299. color: '#fff'
  300. }
  301. },
  302. data: eval(bottom)
  303. }
  304. ],
  305. yAxis: [
  306. {
  307. type: 'value',
  308. axisLabel: {
  309. interval: 0,
  310. textStyle: {
  311. color: '#fff'
  312. }
  313. }
  314. }
  315. ],
  316. series: [
  317. {
  318. name: '业务数量',
  319. type: 'line',
  320. data: eval(d1),
  321. markPoint: {
  322. data: [
  323. { type: 'max', name: '最大值' },
  324. { type: 'min', name: '最小值' }
  325. ]
  326. }
  327. //,
  328. //markLine: {
  329. // data: [
  330. // { type: 'average', name: '平均值' }
  331. // ]
  332. //}
  333. },
  334. {
  335. name: '语音业务数量',
  336. type: 'line',
  337. data: eval(d2),
  338. markPoint: {
  339. data: [
  340. { type: 'max', name: '最大值' },
  341. { type: 'min', name: '最小值' }
  342. ]
  343. }
  344. //,
  345. //markLine: {
  346. // data: [
  347. // { type: 'average', name: '平均值' }
  348. // ]
  349. //}
  350. },
  351. {
  352. name: '在线业务数量',
  353. type: 'line',
  354. data: eval(d3),
  355. markPoint: {
  356. data: [
  357. { type: 'max', name: '最大值' },
  358. { type: 'min', name: '最小值' }
  359. ]
  360. }
  361. //,
  362. //markLine: {
  363. // data: [
  364. // { type: 'average', name: '平均值' }
  365. // ]
  366. //}
  367. },
  368. {
  369. name: '微信业务数量',
  370. type: 'line',
  371. data: eval(d4),
  372. markPoint: {
  373. data: [
  374. { type: 'max', name: '最大值' },
  375. { type: 'min', name: '最小值' }
  376. ]
  377. }
  378. //,
  379. //markLine: {
  380. // data: [
  381. // { type: 'average', name: '平均值' }
  382. // ]
  383. //}
  384. },
  385. {
  386. name: '微博业务数量',
  387. type: 'line',
  388. data: eval(d5),
  389. markPoint: {
  390. data: [
  391. { type: 'max', name: '最大值' },
  392. { type: 'min', name: '最小值' }
  393. ]
  394. }
  395. //,
  396. //markLine: {
  397. // data: [
  398. // { type: 'average', name: '平均值' }
  399. // ]
  400. //}
  401. }
  402. ]
  403. };
  404. // 为echarts对象加载数据
  405. myChart.setOption(option);
  406. }
  407. );
  408. }
  409. }
  410. });
  411. }
  412. //获取坐席处理量报表
  413. function InitUserWorkMonth(thisYear, thisMonth, ThisDateDept) {
  414. var thisTittle = thisYear + '年' + thisMonth + '月坐席处理量报表';
  415. $(".zxcll").html(thisTittle);
  416. var bottom, dataModel;
  417. $.ajax({
  418. url: "/Report/WorkOrderTrainFunctionMathChartData",
  419. type: "get",
  420. contentType: "application/json",
  421. dataType: "text",
  422. cache: false,
  423. data: {
  424. NowDateTime: new Date(), dateParty: ThisDateDept
  425. },
  426. success: function (result, status) {
  427. if (status) {
  428. dataModel = JSON.parse(result);
  429. bottom = dataModel.bottom;
  430. // 使用
  431. require(
  432. [
  433. 'echarts',
  434. 'echarts/chart/bar' // 使用柱状图就加载bar模块,按需加载
  435. , 'echarts/chart/line' // 使用柱状图就加载bar模块,按需加载
  436. ],
  437. function (ec) {
  438. var dahuatheme
  439. require(['echarts/theme/dahua'], function (theme) {
  440. dahuatheme = theme;
  441. });
  442. // 基于准备好的dom,初始化echarts图表
  443. var myChart = ec.init(document.getElementById('workMonth'), dahuatheme);
  444. option = {
  445. title: {
  446. show: false,
  447. text: '',
  448. subtext: ''
  449. },
  450. tooltip: {
  451. trigger: 'axis'
  452. },
  453. legend: {
  454. textStyle: {
  455. color: '#fff' // 图例文字颜色
  456. },
  457. data: ['业务数量', '语音业务数量', '在线业务数量', '微信业务数量', '微博业务数量']
  458. },
  459. toolbox: {
  460. show: false,
  461. feature: {
  462. dataView: { show: true, readOnly: false },
  463. magicType: { show: true, type: ['line', 'bar'] },
  464. restore: { show: true },
  465. saveAsImage: { show: true }
  466. }
  467. },
  468. calculable: true,
  469. xAxis: [
  470. {
  471. type: 'category',
  472. axisLabel: {
  473. interval: 0,
  474. textStyle: {
  475. color: '#fff'
  476. }
  477. },
  478. data: eval(bottom)
  479. }
  480. ],
  481. yAxis: [
  482. {
  483. type: 'value',
  484. axisLabel: {
  485. interval: 0,
  486. textStyle: {
  487. color: '#fff'
  488. }
  489. }
  490. }
  491. ],
  492. series: [
  493. {
  494. name: '业务数量',
  495. type: 'line',
  496. data: eval(dataModel.d1),
  497. markPoint: {
  498. data: [
  499. { type: 'max', name: '最大值' },
  500. { type: 'min', name: '最小值' }
  501. ]
  502. }
  503. },
  504. {
  505. name: '咨询',
  506. type: 'line',
  507. data: eval(dataModel.d2),
  508. markPoint: {
  509. data: [
  510. { type: 'max', name: '最大值' },
  511. { type: 'min', name: '最小值' }
  512. ]
  513. }
  514. },
  515. {
  516. name: '建议',
  517. type: 'line',
  518. data: eval(dataModel.d3),
  519. markPoint: {
  520. data: [
  521. { type: 'max', name: '最大值' },
  522. { type: 'min', name: '最小值' }
  523. ]
  524. }
  525. },
  526. {
  527. name: '表扬',
  528. type: 'line',
  529. data: eval(dataModel.d4),
  530. markPoint: {
  531. data: [
  532. { type: 'max', name: '最大值' },
  533. { type: 'min', name: '最小值' }
  534. ]
  535. }
  536. },
  537. {
  538. name: '挂失',
  539. type: 'line',
  540. data: eval(dataModel.d5),
  541. markPoint: {
  542. data: [
  543. { type: 'max', name: '最大值' },
  544. { type: 'min', name: '最小值' }
  545. ]
  546. }
  547. }
  548. ,
  549. {
  550. name: '投诉',
  551. type: 'line',
  552. data: eval(dataModel.d6),
  553. markPoint: {
  554. data: [
  555. { type: 'max', name: '最大值' },
  556. { type: 'min', name: '最小值' }
  557. ]
  558. }
  559. }
  560. ,
  561. {
  562. name: '转办投诉',
  563. type: 'line',
  564. data: eval(dataModel.d7),
  565. markPoint: {
  566. data: [
  567. { type: 'max', name: '最大值' },
  568. { type: 'min', name: '最小值' }
  569. ]
  570. }
  571. }
  572. ,
  573. {
  574. name: '现场处理投诉',
  575. type: 'line',
  576. data: eval(dataModel.d8),
  577. markPoint: {
  578. data: [
  579. { type: 'max', name: '最大值' },
  580. { type: 'min', name: '最小值' }
  581. ]
  582. }
  583. }
  584. ,
  585. {
  586. name: '客服处理投诉',
  587. type: 'line',
  588. data: eval(dataModel.d9),
  589. markPoint: {
  590. data: [
  591. { type: 'max', name: '最大值' },
  592. { type: 'min', name: '最小值' }
  593. ]
  594. }
  595. }
  596. ]
  597. };
  598. // 为echarts对象加载数据
  599. myChart.setOption(option);
  600. }
  601. );
  602. }
  603. }
  604. });
  605. }
  606. //来电时间分布
  607. function InitCallInMonth(divId, ThisDateDept) {
  608. var format, bottom, datas;
  609. $.ajax({
  610. url: "/Report/CallInMatchChartData",
  611. type: "get",
  612. contentType: "application/json",
  613. dataType: "text",
  614. cache: false,
  615. data: {
  616. NowDateTime: new Date(), dateParty: ThisDateDept
  617. },
  618. success: function (result, status) {
  619. if (status) {
  620. var dataModel = JSON.parse(result);
  621. format = dataModel.format;
  622. bottom = JSON.parse(dataModel.bottom);
  623. datas = JSON.parse(dataModel.datas);
  624. // 使用
  625. require(
  626. [
  627. 'echarts',
  628. 'echarts/chart/bar', // 使用柱状图就加载bar模块,按需加载
  629. 'echarts/chart/line'
  630. ],
  631. function (ec) {
  632. var dahuatheme
  633. require(['echarts/theme/dahua'], function (theme) {
  634. dahuatheme = theme;
  635. });
  636. // 基于准备好的dom,初始化echarts图表
  637. var myChart = ec.init(document.getElementById(divId), dahuatheme);
  638. option = {
  639. title: {
  640. show: false,
  641. text: '',
  642. subtext: ''
  643. },
  644. tooltip: {
  645. trigger: 'axis'
  646. },
  647. legend: {
  648. textStyle: {
  649. color: '#fff' // 图例文字颜色
  650. },
  651. data: ["数量"]
  652. },
  653. toolbox: {
  654. show: false,
  655. feature: {
  656. dataView: { show: true, readOnly: false },
  657. magicType: { show: true, type: ['line', 'bar'] },
  658. restore: { show: true },
  659. saveAsImage: { show: true }
  660. }
  661. },
  662. calculable: true,
  663. xAxis: [
  664. {
  665. type: 'category',
  666. axisLabel: {
  667. interval: 0,
  668. textStyle: {
  669. color: '#fff'
  670. }
  671. },
  672. data: bottom
  673. }
  674. ],
  675. yAxis: [
  676. {
  677. type: 'value',
  678. axisLabel: {
  679. interval: 0,
  680. formatter: '{value} 个',
  681. textStyle: {
  682. color: '#fff'
  683. }
  684. }
  685. }
  686. ],
  687. series: [
  688. {
  689. name: '数量',
  690. type: 'line',
  691. data: datas,
  692. markPoint: {
  693. data: [
  694. { type: 'max', name: '最大值' },
  695. { type: 'min', name: '最小值' }
  696. ]
  697. }
  698. }
  699. ]
  700. };
  701. // 为echarts对象加载数据
  702. myChart.setOption(option);
  703. }
  704. );
  705. }
  706. }
  707. });
  708. }
  709. //业务种类
  710. function InitBussTypeMath(ThisDateDept) {
  711. var format, bottom, datas;
  712. $.ajax({
  713. url: "/Report/WorkOrderTypeMathChartData",
  714. type: "get",
  715. contentType: "application/json",
  716. dataType: "text",
  717. cache: false,
  718. data: {
  719. NowDateTime: new Date(), dateParty: ThisDateDept
  720. },
  721. success: function (result, status) {
  722. if (status) {
  723. var dataModel = JSON.parse(result);
  724. format = dataModel.format;
  725. bottom = JSON.parse(dataModel.bottom);
  726. datas = dataModel.datas;
  727. var dataContent = "";
  728. if (datas != null && eval(datas).length > 0) {
  729. for (var i = eval(datas).length-1; i >=0 ; i--) {
  730. dataContent += eval(datas)[i]["name"] + ':<span id="problem_id00">' + eval(datas)[i]["value"] + '</span> <br>';
  731. }
  732. }
  733. $(".dataContent").html(dataContent);
  734. // 使用
  735. require(
  736. [
  737. 'echarts',
  738. 'echarts/chart/pie' // 使用柱状图就加载bar模块,按需加载
  739. ],
  740. function (ec) {
  741. var dahuatheme
  742. require(['echarts/theme/dahua'], function (theme) {
  743. dahuatheme = theme;
  744. });
  745. // 基于准备好的dom,初始化echarts图表
  746. var myChart = ec.init(document.getElementById('bussTypeMatch'), dahuatheme);
  747. option = {
  748. title: {
  749. show: false,
  750. text: '',
  751. subtext: '',
  752. x: 'center'
  753. },
  754. tooltip: {
  755. trigger: 'item',
  756. formatter: "{a} <br/>{b} : {c} ({d}%)"
  757. },
  758. toolbox: {
  759. show: false,
  760. feature: {
  761. dataView: {
  762. show: true,
  763. title: '数据视图',
  764. readOnly: true,
  765. lang: ['数据视图', '关闭', '刷新']
  766. },
  767. saveAsImage: {
  768. show: true,
  769. title: '保存为图片',
  770. type: 'png',
  771. lang: ['点击保存']
  772. }
  773. }
  774. },
  775. legend: {
  776. textStyle: {
  777. color: '#fff' // 图例文字颜色
  778. },
  779. show: true,
  780. orient: 'horizontal',
  781. bottom: 20,
  782. data: bottom
  783. },
  784. series: [
  785. {
  786. name: '工单类型',
  787. type: 'pie',
  788. radius: '55%',
  789. center: ['50%', '55%'],
  790. data: eval(datas)
  791. ,
  792. itemStyle: {
  793. emphasis: {
  794. shadowBlur: 10,
  795. shadowOffsetX: 0,
  796. shadowColor: 'rgba(0, 0, 0, 0.5)'
  797. }
  798. }
  799. }
  800. ]
  801. };
  802. // 为echarts对象加载数据
  803. myChart.setOption(option);
  804. }
  805. );
  806. }
  807. }
  808. });
  809. }
  810. //业务渠道
  811. function InitBussFormMath(ThisDateDept) {
  812. var format, bottom, datas;
  813. $.ajax({
  814. url: "/Report/WorkOrderFromChartData",
  815. type: "get",
  816. contentType: "application/json",
  817. dataType: "text",
  818. cache: false,
  819. data: {
  820. NowDateTime: new Date(), dateParty: ThisDateDept
  821. },
  822. success: function (result, status) {
  823. if (status) {
  824. var dataModel = JSON.parse(result);
  825. format = dataModel.format;
  826. bottom = JSON.parse(dataModel.bottom);
  827. datas = dataModel.datas;
  828. var dataContent = "";
  829. if (datas != null && eval(datas).length > 0) {
  830. for (var i = 0; i < eval(datas).length ; i++) {
  831. dataContent += eval(datas)[i]["name"] + ':<span id="problem_id00">' + eval(datas)[i]["value"] + '</span> <br>';
  832. }
  833. }
  834. $(".formContent").html(dataContent);
  835. // 使用
  836. require(
  837. [
  838. 'echarts',
  839. 'echarts/chart/pie' // 使用柱状图就加载bar模块,按需加载
  840. ],
  841. function (ec) {
  842. var dahuatheme
  843. require(['echarts/theme/dahua'], function (theme) {
  844. dahuatheme = theme;
  845. });
  846. // 基于准备好的dom,初始化echarts图表
  847. var myChart = ec.init(document.getElementById('bussFormMatch'), dahuatheme);
  848. option = {
  849. title: {
  850. show: false,
  851. text: '',
  852. subtext: '',
  853. x: 'center'
  854. },
  855. tooltip: {
  856. trigger: 'item',
  857. formatter: "{a} <br/>{b} : {c} ({d}%)"
  858. },
  859. toolbox: {
  860. show: false,
  861. feature: {
  862. dataView: {
  863. show: true,
  864. title: '数据视图',
  865. readOnly: true,
  866. lang: ['数据视图', '关闭', '刷新']
  867. },
  868. saveAsImage: {
  869. show: true,
  870. title: '保存为图片',
  871. type: 'png',
  872. lang: ['点击保存']
  873. }
  874. }
  875. },
  876. legend: {
  877. textStyle: {
  878. color: '#fff' // 图例文字颜色
  879. },
  880. show: true,
  881. orient: 'horizontal',
  882. bottom: 20,
  883. data: bottom
  884. },
  885. series: [
  886. {
  887. name: '渠道',
  888. type: 'pie',
  889. radius: '55%',
  890. center: ['50%', '55%'],
  891. data: eval(datas)
  892. ,
  893. itemStyle: {
  894. emphasis: {
  895. shadowBlur: 10,
  896. shadowOffsetX: 0,
  897. shadowColor: 'rgba(0, 0, 0, 0.5)'
  898. }
  899. }
  900. }
  901. ]
  902. };
  903. // 为echarts对象加载数据
  904. myChart.setOption(option);
  905. }
  906. );
  907. }
  908. }
  909. });
  910. }
  911. //初始化业务报表
  912. function InitDate() {
  913. //当前月份的起始日期
  914. var thisMonthDept = getMonthStartDate() + '-' + getMonthEndDate();
  915. //获取坐席话务量报表
  916. InitUserCallMonth(nowYear, nowMonth + 1, thisMonthDept);
  917. //获取坐席业务量报表
  918. InitUserBussMonth(nowYear, nowMonth + 1, thisMonthDept);
  919. //获取坐席处理量报表
  920. InitUserWorkMonth(nowYear, nowMonth + 1, thisMonthDept);
  921. //年来电高峰趋势图
  922. InitCallInMonth("year", nowYear + "-01-01-" + getMonthEndDate());
  923. //月来电高峰趋势图
  924. InitCallInMonth("month", thisMonthDept);
  925. //周来电高峰趋势图
  926. InitCallInMonth("week", getWeekStartDate() + "-" + getWeekEndDate());
  927. //日来电高峰趋势图
  928. var thisDay = formatDate(new Date(nowYear, nowMonth, nowDay)) + "-" + formatDate(new Date(nowYear, nowMonth, nowDay));
  929. InitCallInMonth("day", thisDay);
  930. //业务种类
  931. InitBussTypeMath(thisDay);
  932. //业务渠道
  933. InitBussFormMath(thisDay);
  934. //开启计时器
  935. setTimeout("InitDate()", 5000)
  936. }
  937. InitDate();
  938. </script>
  939. </head>
  940. <body>
  941. <!-- <div class="bg"><img src="/Content/images/screendisplay/bg.jpg"></div> -->
  942. <!-- <canvas id="canvas" style="position: absolute; top: 0; width: 100%"></canvas> -->
  943. <div class="bg01"> </div>
  944. <div class="main" id="pt_top" style="padding: 0">
  945. <img src="/Content/images/screendisplay/logo.png" class="logo">
  946. <div class="date_div">
  947. <div class="date" id="date"><label></label><time></time></div>
  948. </div>
  949. <div class="tit">
  950. <div class="tit_div">
  951. <h1>网络化信息服务平台</h1>
  952. <h2>Network information service platform</h2>
  953. </div>
  954. </div>
  955. <div class="left01">
  956. <div class="swiper-container">
  957. <div class="swiper-wrapper">
  958. <div class="swiper-slide">
  959. <div class="sj_tit zxhwl"></div>
  960. <div id="callMonth" style="border:0px;width:100%;height:80%;"></div>
  961. </div>
  962. <div class="swiper-slide">
  963. <div class="sj_tit zxywl"></div>
  964. <div id="bussMonth" style="border:0px;width:100%;height:80%;"></div>
  965. </div>
  966. <div class="swiper-slide">
  967. <div class="sj_tit zxcll"></div>
  968. <div id="workMonth" style="border:0px;width:100%;height:80%;"></div>
  969. </div>
  970. </div>
  971. <!-- Add Pagination -->
  972. <div class="swiper-pagination"></div>
  973. </div>
  974. </div>
  975. <div class="right01">
  976. <div class="right_cont01" style="width: 100% !important">
  977. <div class="right_cont01_left" style="width:100px!important;">
  978. <h1>业务种类</h1>
  979. <p class="dataContent">
  980. </p>
  981. </div>
  982. <div class="right_cont01_right" style="width:calc(100%-100px)!important;height:240px;">
  983. <div id="bussTypeMatch" style="border:0px;width:100%;height:100%;"></div>
  984. </div>
  985. </div>
  986. <div class="right_cont02" style="width: 100% !important">
  987. >
  988. <div class="right_cont01_left" style="width:100px!important;">
  989. <h1>业务种类</h1>
  990. <p class="formContent">
  991. </p>
  992. </div>
  993. <div class="right_cont01_right" style="width:calc(100%-100px)!important;height:240px;">
  994. <div id="bussFormMatch" style="border:0px;width:100%;height:100%;"></div>
  995. </div>
  996. </div>
  997. </div>
  998. </div>
  999. <div class="main">
  1000. <div class="bt_left" id="bt_left">
  1001. <div class="bt_tit">本年来电高峰时间分布</div>
  1002. <div id="year" style="border:0px;width:100%;height:80%;"></div>
  1003. </div>
  1004. <div class="bt_mid" id="bt_mid">
  1005. <a href="iframe.html" target="_blank">
  1006. <div class="bt_tit">本月来电高峰时间分布</div>
  1007. <div id="month" style="border:0px;width:100%;height:80%;"></div>
  1008. </a>
  1009. </div>
  1010. <div class="bt_right">
  1011. <div class="bt_tit">本周来电高峰时间分布</div>
  1012. <div id="week" style="border:0px;width:100%;height:80%;"></div>
  1013. </div>
  1014. <div class="bt_right">
  1015. <div class="bt_tit">今日来电高峰时间分布</div>
  1016. <div id="day" style="border:0px;width:100%;height:80%;"></div>
  1017. </div>
  1018. </div>
  1019. <!-- 在线人数 -->
  1020. <div class="layer" id="layer_people" onclick="document.getElementById('layer_people').className='layer'">
  1021. <div>
  1022. <div class="layer-content">
  1023. <!-- <i class="close-layer" onclick="document.getElementById('layer_people').className='layer'">x</i> -->
  1024. <div class="bt_tit01">在线人数</div>
  1025. <div class="layer_people">
  1026. <div class="sj">
  1027. <img src="/Content/images/screendisplay/bt01_blue.png" class="blue">
  1028. <img src="/Content/images/screendisplay/bt01_red.png" class="red">
  1029. </div>
  1030. </div>
  1031. </div>
  1032. </div>
  1033. </div>
  1034. <!-- 业务指标 -->
  1035. <!-- <div class="layer" id="layer_ywzb" onclick="document.getElementById('layer_ywzb').className='layer'">
  1036. <div>
  1037. <div class="layer-content" style="width:70%;">
  1038. <i class="close-layer" onclick="document.getElementById('layer_ywzb').className='layer'">x</i>
  1039. <div class="bt_tit01">业务指标</div>
  1040. <div class="layer_ywzb">
  1041. <img src="/Content/images/screendisplay/bt02_img.jpg" style="width: 90%">
  1042. </div>
  1043. </div>
  1044. </div>
  1045. </div> -->
  1046. <canvas id="canv" width="845" height="917" style="position: fixed; width: 100%; height: 100%; top: 0; z-index: -1"></canvas>
  1047. <!-- 加载动画 -->
  1048. <div class="loaders" id="loader">
  1049. <div class="loader">
  1050. <div class="loader-inner ball-spin-fade-loader">
  1051. <div></div>
  1052. <div></div>
  1053. <div></div>
  1054. <div></div>
  1055. <div></div>
  1056. <div></div>
  1057. <div></div>
  1058. <div></div>
  1059. </div>
  1060. </div>
  1061. </div>
  1062. <!-- 加载动画 结束 -->
  1063. <script src="/Content/js/screendisplay/zepto.min.js"></script>
  1064. <!-- <script type="text/javascript" src="js/canvas.js"></script> -->
  1065. <script src="/Content/js/screendisplay/swiper.min.js"></script>
  1066. <!-- Initialize Swiper -->
  1067. <script>
  1068. window.onload = function (event) {
  1069. $(".main").addClass("active")
  1070. $("#loader").hide();
  1071. }
  1072. //var h=$(window).height()
  1073. window.onresize = function () {
  1074. var h = $(window).height()
  1075. if (h > 920) {
  1076. $("#pt_top").css({ "padding": "2.5vw 0 2vw 0" })
  1077. $(".tit").css({ "padding": "1.5vw 0 2vw 0" })
  1078. $(".logo").css({ "top": "4vw" })
  1079. console.log($(window).height())
  1080. } else {
  1081. $("#pt_top").css({ "padding": "0%" })
  1082. $(".tit").css({ "padding": "1.5vw 0 0vw 0" })
  1083. $(".logo").css({ "top": "1.4vw" })
  1084. }
  1085. }
  1086. //判断浏览器是否全屏
  1087. $(document).on('keydown', function (e) {
  1088. var e = event || window.event || arguments.callee.caller.arguments[0];
  1089. if (e && e.keyCode == 122) {//捕捉F11键盘动作
  1090. e.preventDefault(); //阻止F11默认动作
  1091. var el = document.documentElement;
  1092. var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;//定义不同浏览器的全屏API      //执行全屏
  1093. if (typeof rfs != "undefined" && rfs) {
  1094. rfs.call(el);
  1095. } else if (typeof window.ActiveXObject != "undefined") {
  1096. var wscript = new ActiveXObject("WScript.Shell");
  1097. if (wscript != null) {
  1098. wscript.SendKeys("{F11}");
  1099. }
  1100. }      //监听不同浏览器的全屏事件,并件执行相应的代码
  1101. document.addEventListener("webkitfullscreenchange", function () {//
  1102. if (document.webkitIsFullScreen) {
  1103. //全屏后要执行的代码
  1104. $("#pt_top").css({ "padding": "2.5vw 0 2vw 0" })
  1105. $(".tit").css({ "padding": "1.5vw 0 2vw 0" })
  1106. $(".logo").css({ "top": "4vw" })
  1107. } else {
  1108. //退出全屏后要执行的代码
  1109. $("#pt_top").css({ "padding": "0%" })
  1110. $(".tit").css({ "padding": "1.5vw 0 0vw 0" })
  1111. $(".logo").css({ "top": "1.4vw" })
  1112. }
  1113. }, false);
  1114. document.addEventListener("fullscreenchange", function () {
  1115. if (document.fullscreen) {
  1116. //全屏后执行的代码
  1117. $("#pt_top").css({ "padding": "2.5vw 0 2vw 0" })
  1118. $(".tit").css({ "padding": "1.5vw 0 2vw 0" })
  1119. $(".logo").css({ "top": "4vw" })
  1120. } else {
  1121. //退出全屏后要执行的代码
  1122. $("#pt_top").css({ "padding": "0%" })
  1123. $(".tit").css({ "padding": "1.5vw 0 0vw 0" })
  1124. $(".logo").css({ "top": "1.4vw" })
  1125. }
  1126. }, false);
  1127. document.addEventListener("mozfullscreenchange", function () {
  1128. if (document.mozFullScreen) {
  1129. //全屏后要执行的代码
  1130. $("#pt_top").css({ "padding": "2.5vw 0 2vw 0" })
  1131. $(".tit").css({ "padding": "1.5vw 0 2vw 0" })
  1132. $(".logo").css({ "top": "4vw" })
  1133. } else {
  1134. //退出全屏后要执行的代码
  1135. $("#pt_top").css({ "padding": "0%" })
  1136. $(".tit").css({ "padding": "1.5vw 0 0vw 0" })
  1137. $(".logo").css({ "top": "1.4vw" })
  1138. }
  1139. }, false);
  1140. document.addEventListener("msfullscreenchange", function () {
  1141. if (document.msFullscreenElement) {
  1142. //全屏后要执行的代码
  1143. $("#pt_top").css({ "padding": "2.5vw 0 2vw 0" })
  1144. $(".tit").css({ "padding": "1.5vw 0 2vw 0" })
  1145. $(".logo").css({ "top": "4vw" })
  1146. } else {
  1147. //退出全屏后要执行的代码
  1148. $("#pt_top").css({ "padding": "0%" })
  1149. $(".tit").css({ "padding": "1.5vw 0 0vw 0" })
  1150. $(".logo").css({ "top": "1.4vw" })
  1151. }
  1152. }, false)
  1153. }
  1154. })
  1155. // 判断各种浏览器,找到正确的方法
  1156. // document.addEventListener('fullscreenchange', function(){ alert("全屏") });
  1157. // document.addEventListener('webkitfullscreenchange', function(){ alert("全屏") });
  1158. // document.addEventListener('mozfullscreenchange', function(){alert("全屏") });
  1159. // document.addEventListener('MSFullscreenChange', function(){ alert("全屏") });
  1160. // W3C Method:
  1161. // 找到适合浏览器的全屏方法
  1162. // 启动全屏!
  1163. //launchFullScreen(document.documentElement); // 整个网页
  1164. var swiper = new Swiper('.swiper-container', {
  1165. pagination: '.swiper-pagination',
  1166. paginationClickable: true,
  1167. autoplay: 3000,
  1168. initialSlide: 1,
  1169. paginationBulletRender: function (index, className) {
  1170. return '<span class="' + className + '">' + (index + 1) + '</span>';
  1171. },
  1172. effect: 'coverflow',
  1173. grabCursor: true,
  1174. centeredSlides: true,
  1175. slidesPerView: 'auto',
  1176. coverflow: {
  1177. rotate: -20,
  1178. stretch: 0,
  1179. depth: 200,
  1180. modifier: 1.5,
  1181. slideShadows: true
  1182. }
  1183. });
  1184. //$("#bt_left").click(function () {
  1185. // $("#layer_people").addClass("active")
  1186. //})
  1187. // $("#bt_mid").click(function() {
  1188. // // $("#layer_ywzb").addClass("active")
  1189. // // window.location="iframe.html"
  1190. // window.open ("iframe.html")
  1191. // })
  1192. // 日期
  1193. var d = new Date()
  1194. var day = d.getDate()
  1195. var month = d.getMonth() + 1
  1196. var year = d.getFullYear()
  1197. // year + "/" + month + "/" + day
  1198. $("#date label").html(year + "/" + month + "/" + day)
  1199. function checkTime(i) {
  1200. if (i < 10) {
  1201. i = "0" + i
  1202. }
  1203. return i
  1204. }
  1205. var h = checkTime(d.getHours())
  1206. var m = checkTime(d.getMinutes())
  1207. $("#date time").html(h + ":" + m)
  1208. // 问题监控
  1209. // var number=Math.floor(Math.random()*3)
  1210. // console.log(number)
  1211. function getRandomInt(min, max) {
  1212. return Math.floor(Math.random() * (max - min + 1)) + min;
  1213. }
  1214. console.log(getRandomInt(-2, 2))
  1215. //setInterval(function () {
  1216. // var problem_id00 = parseInt($("#problem_id00").text());
  1217. // problem_id00 += getRandomInt(-1, 2);
  1218. // var problem_id01 = parseInt($("#problem_id01").text());
  1219. // problem_id01 += getRandomInt(-1, 2);
  1220. // var problem_id02 = parseInt($("#problem_id02").text());
  1221. // problem_id02 += getRandomInt(-1, 2);
  1222. // var problem_id03 = parseInt($("#problem_id03").text());
  1223. // problem_id03 += getRandomInt(-1, 2);
  1224. // var problem_id04 = parseInt($("#problem_id04").text());
  1225. // problem_id04 += getRandomInt(-1, 2);
  1226. // $("#problem_id00").text(problem_id00)
  1227. // $("#problem_id01").text(problem_id01)
  1228. // $("#problem_id02").text(problem_id02)
  1229. // $("#problem_id03").text(problem_id03)
  1230. // $("#problem_id04").text(problem_id04)
  1231. // var event_id00 = parseInt($("#event_id00").text());
  1232. // event_id00 += getRandomInt(0, 2);
  1233. // var event_id01 = parseInt($("#event_id01").text());
  1234. // event_id01 += getRandomInt(-1, 3);
  1235. // var event_id02 = parseInt($("#event_id02").text());
  1236. // event_id02 += getRandomInt(-1, 3);
  1237. // var event_id03 = parseInt($("#event_id03").text());
  1238. // event_id03 += getRandomInt(-1, 3);
  1239. // var event_id04 = parseInt($("#event_id04").text());
  1240. // event_id04 += getRandomInt(-1, 3);
  1241. // $("#event_id00").text(event_id00)
  1242. // $("#event_id01").text(event_id01)
  1243. // $("#event_id02").text(event_id02)
  1244. // $("#event_id03").text(event_id03)
  1245. // $("#event_id04").text(event_id04)
  1246. //}, 3000)
  1247. </script>
  1248. <!-- 离子动画 -->
  1249. <script>
  1250. var num = 100;
  1251. var w = window.innerWidth;
  1252. var h = window.innerHeight;
  1253. var max = 100;
  1254. var _x = 0;
  1255. var _y = 0;
  1256. var _z = 150;
  1257. var dtr = function (d) {
  1258. return d * Math.PI / 180;
  1259. };
  1260. var rnd = function () {
  1261. return Math.sin(Math.floor(Math.random() * 360) * Math.PI / 180);
  1262. };
  1263. var dist = function (p1, p2, p3) {
  1264. return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2) + Math.pow(p2.z - p1.z, 2));
  1265. };
  1266. var cam = {
  1267. obj: {
  1268. x: _x,
  1269. y: _y,
  1270. z: _z
  1271. },
  1272. dest: {
  1273. x: 0,
  1274. y: 0,
  1275. z: 1
  1276. },
  1277. dist: {
  1278. x: 0,
  1279. y: 0,
  1280. z: 200
  1281. },
  1282. ang: {
  1283. cplane: 0,
  1284. splane: 0,
  1285. ctheta: 0,
  1286. stheta: 0
  1287. },
  1288. zoom: 1,
  1289. disp: {
  1290. x: w / 2,
  1291. y: h / 2,
  1292. z: 0
  1293. },
  1294. upd: function () {
  1295. cam.dist.x = cam.dest.x - cam.obj.x;
  1296. cam.dist.y = cam.dest.y - cam.obj.y;
  1297. cam.dist.z = cam.dest.z - cam.obj.z;
  1298. cam.ang.cplane = -cam.dist.z / Math.sqrt(cam.dist.x * cam.dist.x + cam.dist.z * cam.dist.z);
  1299. cam.ang.splane = cam.dist.x / Math.sqrt(cam.dist.x * cam.dist.x + cam.dist.z * cam.dist.z);
  1300. cam.ang.ctheta = Math.sqrt(cam.dist.x * cam.dist.x + cam.dist.z * cam.dist.z) / Math.sqrt(cam.dist.x * cam.dist.x + cam.dist.y * cam.dist.y + cam.dist.z * cam.dist.z);
  1301. cam.ang.stheta = -cam.dist.y / Math.sqrt(cam.dist.x * cam.dist.x + cam.dist.y * cam.dist.y + cam.dist.z * cam.dist.z);
  1302. }
  1303. };
  1304. var trans = {
  1305. parts: {
  1306. sz: function (p, sz) {
  1307. return {
  1308. x: p.x * sz.x,
  1309. y: p.y * sz.y,
  1310. z: p.z * sz.z
  1311. };
  1312. },
  1313. rot: {
  1314. x: function (p, rot) {
  1315. return {
  1316. x: p.x,
  1317. y: p.y * Math.cos(dtr(rot.x)) - p.z * Math.sin(dtr(rot.x)),
  1318. z: p.y * Math.sin(dtr(rot.x)) + p.z * Math.cos(dtr(rot.x))
  1319. };
  1320. },
  1321. y: function (p, rot) {
  1322. return {
  1323. x: p.x * Math.cos(dtr(rot.y)) + p.z * Math.sin(dtr(rot.y)),
  1324. y: p.y,
  1325. z: -p.x * Math.sin(dtr(rot.y)) + p.z * Math.cos(dtr(rot.y))
  1326. };
  1327. },
  1328. z: function (p, rot) {
  1329. return {
  1330. x: p.x * Math.cos(dtr(rot.z)) - p.y * Math.sin(dtr(rot.z)),
  1331. y: p.x * Math.sin(dtr(rot.z)) + p.y * Math.cos(dtr(rot.z)),
  1332. z: p.z
  1333. };
  1334. }
  1335. },
  1336. pos: function (p, pos) {
  1337. return {
  1338. x: p.x + pos.x,
  1339. y: p.y + pos.y,
  1340. z: p.z + pos.z
  1341. };
  1342. }
  1343. },
  1344. pov: {
  1345. plane: function (p) {
  1346. return {
  1347. x: p.x * cam.ang.cplane + p.z * cam.ang.splane,
  1348. y: p.y,
  1349. z: p.x * -cam.ang.splane + p.z * cam.ang.cplane
  1350. };
  1351. },
  1352. theta: function (p) {
  1353. return {
  1354. x: p.x,
  1355. y: p.y * cam.ang.ctheta - p.z * cam.ang.stheta,
  1356. z: p.y * cam.ang.stheta + p.z * cam.ang.ctheta
  1357. };
  1358. },
  1359. set: function (p) {
  1360. return {
  1361. x: p.x - cam.obj.x,
  1362. y: p.y - cam.obj.y,
  1363. z: p.z - cam.obj.z
  1364. };
  1365. }
  1366. },
  1367. persp: function (p) {
  1368. return {
  1369. x: p.x * cam.dist.z / p.z * cam.zoom,
  1370. y: p.y * cam.dist.z / p.z * cam.zoom,
  1371. z: p.z * cam.zoom,
  1372. p: cam.dist.z / p.z
  1373. };
  1374. },
  1375. disp: function (p, disp) {
  1376. return {
  1377. x: p.x + disp.x,
  1378. y: -p.y + disp.y,
  1379. z: p.z + disp.z,
  1380. p: p.p
  1381. };
  1382. },
  1383. steps: function (_obj_, sz, rot, pos, disp) {
  1384. var _args = trans.parts.sz(_obj_, sz);
  1385. _args = trans.parts.rot.x(_args, rot);
  1386. _args = trans.parts.rot.y(_args, rot);
  1387. _args = trans.parts.rot.z(_args, rot);
  1388. _args = trans.parts.pos(_args, pos);
  1389. _args = trans.pov.plane(_args);
  1390. _args = trans.pov.theta(_args);
  1391. _args = trans.pov.set(_args);
  1392. _args = trans.persp(_args);
  1393. _args = trans.disp(_args, disp);
  1394. return _args;
  1395. }
  1396. };
  1397. (function () {
  1398. "use strict";
  1399. var threeD = function (param) {
  1400. this.transIn = {};
  1401. this.transOut = {};
  1402. this.transIn.vtx = (param.vtx);
  1403. this.transIn.sz = (param.sz);
  1404. this.transIn.rot = (param.rot);
  1405. this.transIn.pos = (param.pos);
  1406. };
  1407. threeD.prototype.vupd = function () {
  1408. this.transOut = trans.steps(
  1409. this.transIn.vtx,
  1410. this.transIn.sz,
  1411. this.transIn.rot,
  1412. this.transIn.pos,
  1413. cam.disp
  1414. );
  1415. };
  1416. var Build = function () {
  1417. this.vel = 0.04;
  1418. this.lim = 360;
  1419. this.diff = 200;
  1420. this.initPos = 100;
  1421. this.toX = _x;
  1422. this.toY = _y;
  1423. this.go();
  1424. };
  1425. Build.prototype.go = function () {
  1426. this.canvas = document.getElementById("canv");
  1427. this.canvas.width = window.innerWidth;
  1428. this.canvas.height = window.innerHeight;
  1429. this.$ = canv.getContext("2d");
  1430. this.$.globalCompositeOperation = 'source-over';
  1431. this.varr = [];
  1432. this.dist = [];
  1433. this.calc = [];
  1434. for (var i = 0, len = num; i < len; i++) {
  1435. this.add();
  1436. }
  1437. this.rotObj = {
  1438. x: 0,
  1439. y: 0,
  1440. z: 0
  1441. };
  1442. this.objSz = {
  1443. x: w / 5,
  1444. y: h / 5,
  1445. z: w / 5
  1446. };
  1447. };
  1448. Build.prototype.add = function () {
  1449. this.varr.push(new threeD({
  1450. vtx: {
  1451. x: rnd(),
  1452. y: rnd(),
  1453. z: rnd()
  1454. },
  1455. sz: {
  1456. x: 0,
  1457. y: 0,
  1458. z: 0
  1459. },
  1460. rot: {
  1461. x: 20,
  1462. y: -20,
  1463. z: 0
  1464. },
  1465. pos: {
  1466. x: this.diff * Math.sin(360 * Math.random() * Math.PI / 180),
  1467. y: this.diff * Math.sin(360 * Math.random() * Math.PI / 180),
  1468. z: this.diff * Math.sin(360 * Math.random() * Math.PI / 180)
  1469. }
  1470. }));
  1471. this.calc.push({
  1472. x: 360 * Math.random(),
  1473. y: 360 * Math.random(),
  1474. z: 360 * Math.random()
  1475. });
  1476. };
  1477. Build.prototype.upd = function () {
  1478. cam.obj.x += (this.toX - cam.obj.x) * 0.05;
  1479. cam.obj.y += (this.toY - cam.obj.y) * 0.05;
  1480. };
  1481. Build.prototype.draw = function () {
  1482. this.$.clearRect(0, 0, this.canvas.width, this.canvas.height);
  1483. cam.upd();
  1484. this.rotObj.x += 0.1;
  1485. this.rotObj.y += 0.1;
  1486. this.rotObj.z += 0.1;
  1487. for (var i = 0; i < this.varr.length; i++) {
  1488. for (var val in this.calc[i]) {
  1489. if (this.calc[i].hasOwnProperty(val)) {
  1490. this.calc[i][val] += this.vel;
  1491. if (this.calc[i][val] > this.lim) this.calc[i][val] = 0;
  1492. }
  1493. }
  1494. this.varr[i].transIn.pos = {
  1495. x: this.diff * Math.cos(this.calc[i].x * Math.PI / 180),
  1496. y: this.diff * Math.sin(this.calc[i].y * Math.PI / 180),
  1497. z: this.diff * Math.sin(this.calc[i].z * Math.PI / 180)
  1498. };
  1499. this.varr[i].transIn.rot = this.rotObj;
  1500. this.varr[i].transIn.sz = this.objSz;
  1501. this.varr[i].vupd();
  1502. if (this.varr[i].transOut.p < 0) continue;
  1503. var g = this.$.createRadialGradient(this.varr[i].transOut.x, this.varr[i].transOut.y, this.varr[i].transOut.p, this.varr[i].transOut.x, this.varr[i].transOut.y, this.varr[i].transOut.p * 2);
  1504. this.$.globalCompositeOperation = 'lighter';
  1505. g.addColorStop(0, 'hsla(255, 255%, 255%, 1)');
  1506. g.addColorStop(.5, 'hsla(' + (i + 2) + ',85%, 40%,1)');
  1507. g.addColorStop(1, 'hsla(' + (i) + ',85%, 40%,.5)');
  1508. this.$.fillStyle = g;
  1509. this.$.beginPath();
  1510. this.$.arc(this.varr[i].transOut.x, this.varr[i].transOut.y, this.varr[i].transOut.p * 2, 0, Math.PI * 2, false);
  1511. this.$.fill();
  1512. this.$.closePath();
  1513. }
  1514. };
  1515. Build.prototype.anim = function () {
  1516. window.requestAnimationFrame = (function () {
  1517. return window.requestAnimationFrame ||
  1518. function (callback, element) {
  1519. window.setTimeout(callback, 1000 / 60);
  1520. };
  1521. })();
  1522. var anim = function () {
  1523. this.upd();
  1524. this.draw();
  1525. window.requestAnimationFrame(anim);
  1526. }.bind(this);
  1527. window.requestAnimationFrame(anim);
  1528. };
  1529. Build.prototype.run = function () {
  1530. this.anim();
  1531. window.addEventListener('mousemove', function (e) {
  1532. this.toX = (e.clientX - this.canvas.width / 2) * -0.8;
  1533. this.toY = (e.clientY - this.canvas.height / 2) * 0.8;
  1534. }.bind(this));
  1535. window.addEventListener('touchmove', function (e) {
  1536. e.preventDefault();
  1537. this.toX = (e.touches[0].clientX - this.canvas.width / 2) * -0.8;
  1538. this.toY = (e.touches[0].clientY - this.canvas.height / 2) * 0.8;
  1539. }.bind(this));
  1540. window.addEventListener('mousedown', function (e) {
  1541. for (var i = 0; i < 100; i++) {
  1542. this.add();
  1543. }
  1544. }.bind(this));
  1545. window.addEventListener('touchstart', function (e) {
  1546. e.preventDefault();
  1547. for (var i = 0; i < 100; i++) {
  1548. this.add();
  1549. }
  1550. }.bind(this));
  1551. };
  1552. var app = new Build();
  1553. app.run();
  1554. })();
  1555. window.addEventListener('resize', function () {
  1556. document.getElementById('canv').width = w = window.innerWidth;
  1557. document.getElementById('canv').height = h = window.innerHeight;
  1558. }, false);
  1559. </script>
  1560. </body>
  1561. </html>