地铁二期项目正式开始

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