deptConsole.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. const $ = require('jquery');
  2. require("../css/reset.less")
  3. require("../css/deptConsole.less")
  4. require("../images/logo.png")
  5. require("../images/arrow_down.png")
  6. // import 'zrender/lib/svg/svg';
  7. const {api} = require('./api.js')
  8. const echarts = require('echarts');
  9. const {post,setCookie,delCookie,getCookie,focusMenuItem} = require('../js/utils.js');
  10. let payMoney = [],dayLis = [],dateType = 2,curDept = '',datafst=[],datasec=[],datatrd=[],datafour=[],hospital=getCookie("hospital");
  11. $(function(){
  12. if(!hasData('YH-KZT')&&!hasData('YH-KZTKS')){
  13. $("body").html('')
  14. }
  15. if(hospital == "台州市立"){
  16. $(".circleBSingle").css("display","block")
  17. $(".circleBLis").css("display","none")
  18. }else{
  19. $(".circleBSingle").css("display","none")
  20. $(".circleBLis").css("display","block")
  21. }
  22. $(".partTitle p span").html(hospital)
  23. setInterval(() => {
  24. getTimeDetail()
  25. }, 1000);
  26. // resizeBox()
  27. initConsole()//质控列表
  28. getOwnDept()
  29. dateChange()
  30. $(window).click(function(){
  31. window.parent.userActionHide()
  32. $(".toggleSlide ul").css("display","none")
  33. })
  34. $(".toggleSlide p").click(function(e){
  35. e.stopPropagation()
  36. $(this).next().slideToggle()
  37. })
  38. tiaomu()
  39. })
  40. function tiaomu(){
  41. $(".defect .partTitlePub").click(function(){
  42. focusMenuItem("YH-KSZR-GMKQXZB_XQ");
  43. $(parent.document).find("#contentIframe").attr("src","mukuai.html?from=2&deptName="+curDept+"&dateType="+dateType)
  44. });
  45. $(".circleBSingle .title,.homePageNo .title").click(function(){
  46. focusMenuItem("YH-KSZR-TMQXZB_XQ");
  47. $(parent.document).find("#contentIframe").attr("src","tiaomu.html?from=2&deptName="+curDept+"&dateType="+dateType)
  48. });
  49. $(".homePage .title").click(function(){
  50. focusMenuItem("YH-KSZR-BASYHGLZB_XQ")
  51. $(parent.document).find("#contentIframe").attr("src","partDetail.html?from=2&deptName="+curDept+"&dateType="+dateType)
  52. });
  53. $(".part02 .bingli,.part02 .bingliLis").click(function(){
  54. focusMenuItem("YH-KSZR-KSQXZB_XQ");
  55. $(parent.document).find("#contentIframe").attr("src","deptScoreDetail.html?from=2&deptName="+curDept+"&dateType="+dateType)
  56. });
  57. }
  58. //判断有无某一权限
  59. function hasData(data){
  60. let lis = JSON.parse(getCookie("codeLis"))||[]
  61. // console.log(lis)
  62. if(lis.indexOf(data)>-1){//有权限
  63. return true
  64. }
  65. return false;
  66. }
  67. function resizeBox(){
  68. $(".partWrap").css({
  69. height:$(window).height()-38+'px'
  70. })
  71. }
  72. //所有数据切换日期筛选
  73. function dateChange(){
  74. $(".monthYear .mon").click(function(){
  75. $(this).css({
  76. backgroundColor:'#00A1FF',
  77. color:'#E9EBEF',
  78. "border-color":'#00A1FF'
  79. }).siblings().css({
  80. "border-color":'#A5ADBF',
  81. color:'#A5ADBF',
  82. backgroundColor:'#203463'
  83. })
  84. dateType = 1
  85. getBarData(1)
  86. })
  87. $(".monthYear .year").click(function(){
  88. $(this).css({
  89. backgroundColor:'#00A1FF',
  90. color:'#E9EBEF',
  91. "border-color":'#00A1FF'
  92. }).siblings().css({
  93. "border-color":'#A5ADBF',
  94. color:'#A5ADBF',
  95. backgroundColor:'#203463'
  96. })
  97. dateType = 2
  98. getBarData(2)
  99. })
  100. }
  101. //控制台数
  102. function initConsole(result){
  103. let url = {
  104. '本月病历数':require("../images/icon6.png"),
  105. '本月不合格病历-机器':require("../images/icon7.png"),
  106. '本月质控数-机器':require("../images/icon10.png"),
  107. '本月甲级病历-机器':require("../images/icon8.png"),
  108. '本月乙级病历-机器':require("../images/icon9.png"),
  109. '本年病历数':require("../images/icon6.png"),
  110. '本年不合格病历-机器':require("../images/icon7.png"),
  111. '本年质控数-机器':require("../images/icon10.png"),
  112. '本年甲级病历-机器':require("../images/icon8.png"),
  113. '本年乙级病历-机器':require("../images/icon9.png"),
  114. }
  115. let dom = '';
  116. for(let i in result){
  117. if(i.indexOf("人工")==-1){
  118. let name = i.split("-")[0];
  119. let num = 0;
  120. if(name=='本月病历数'||name=='本年病历数'){
  121. num = result[i]
  122. }else{
  123. num = result[name+'-人工']+result[i]
  124. }
  125. dom += `
  126. <li class="partLi">
  127. <div class="partIn">
  128. <p class="top">${name}</p>
  129. <p class="btm clearfix">
  130. <img src="${url[i]}" alt="">
  131. <span>${num}</span>
  132. </p>
  133. </div>
  134. </li>
  135. `
  136. }
  137. }
  138. $(".partAll").html(dom)
  139. }
  140. //获取科室列表
  141. function getOwnDept(){
  142. // if(hasData('FUNC000058')){
  143. post(api.getDept,{}).then((res)=>{
  144. let data = res.data;
  145. if(data.code == 0){
  146. let result = data.data
  147. renderDeptLis(result)//科室tab渲染
  148. curDept = result[0].deptName
  149. $(".partTitle p i,.toggleSlide p span").html(curDept).attr({"title":curDept,'data-dept':curDept})
  150. getBarData(2)//图标数据获取
  151. }else {
  152. $(".partTitle p i,.toggleSlide p span").html('--')
  153. }
  154. }).catch(()=>{
  155. $(".partTitle p i,.toggleSlide p span").html('--')
  156. })
  157. // }
  158. }
  159. function renderDeptLis(data){
  160. let str = ''
  161. for(let i = 0; i < data.length;i++){
  162. str += `
  163. <li title="${data[i].deptName}" class="${i == 0?'li0 toggleAverge toggleSlide1':'toggleAverge toggleSlide1'}" data-dept="${data[i].deptName}">${data[i].deptName}</li>
  164. `
  165. }
  166. $(".toggleSlide ul").html(str)
  167. $(".toggleSlide ul li").click(function(){
  168. let name = $(this).attr("data-dept")
  169. curDept = name
  170. $(this).parent().slideToggle().prev().find("span").html(name).attr({"title":name,'data-dept':curDept})
  171. $(".partTitle p i").html(name).attr({"title":name,'data-dept':curDept})
  172. personNum(datafst[name]||[])
  173. setNumDetail(datasec[name]||[])
  174. queList(datatrd[name]||[])
  175. for(let i = 0;i < datafour[name].length;i++){
  176. datafour[name][i].value = datafour[name][i].num
  177. }
  178. if(hospital=="台州市立"){
  179. emptyCircleB(datafour[name])
  180. panDetailB(datafour[name])
  181. }else{
  182. emptyCircleBc(datafour[name])
  183. panDetailBc(datafour[name])
  184. }
  185. $(this).addClass("li0").siblings().removeClass("li0")
  186. })
  187. }
  188. //获取图表数据
  189. function getBarData(type){
  190. if(hasData('FUNC000054')){
  191. post(api.leaveHosCountByDept,{//出院人数统计
  192. "type": type||1//1月2年
  193. }).then((res)=>{
  194. let data = res.data;
  195. if(data.code == 0){
  196. let result = data.data[curDept]||[]
  197. datafst = data.data
  198. personNum(result)
  199. }
  200. })
  201. }
  202. if(hasData('FUNC000055')){
  203. post(api.mrCountByDept,{//质控病历统计
  204. "type": type||1//1月2年
  205. }).then((res)=>{
  206. let data = res.data
  207. if(data.code == 0){
  208. let result3 = data.data[curDept]||[]
  209. datasec = data.data
  210. setNumDetail(result3)
  211. }
  212. })
  213. }
  214. if(hasData('FUNC000056')){
  215. post(api.entryCountGroupByCaseAndDept,{//各模块缺陷占比排行
  216. "type": type||1//1月2年
  217. }).then((res)=>{
  218. let data = res.data;
  219. if(data.code == 0){
  220. let result1 = data.data[curDept]||[]
  221. datatrd = data.data
  222. queList(result1)
  223. }
  224. })
  225. }
  226. if(hasData('FUNC000057')){
  227. if(hospital=="台州市立"){
  228. post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
  229. "type": type||1//1月2年
  230. }).then((res)=>{
  231. let data = res.data;
  232. if(data.code == 0){
  233. let result3 = data.data[curDept]||[]
  234. for(let i = 0;i < result3.length;i++){
  235. result3[i].value = result3[i].num
  236. }
  237. datafour = data.data
  238. emptyCircleB(result3)
  239. panDetailB(result3)
  240. }
  241. })
  242. }else{
  243. post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
  244. "type": type||1//1月2年
  245. }).then((res)=>{
  246. let data = res.data;
  247. if(data.code == 0){
  248. let result3 = data.data[curDept]||[]
  249. for(let i = 0;i < result3.length;i++){
  250. result3[i].value = result3[i].num
  251. }
  252. datafour = data.data
  253. emptyCircleBc(result3)
  254. panDetailBc(result3)
  255. }
  256. })
  257. }
  258. }
  259. if(hospital=="长兴医院"&&hasData("FUNC000076")){
  260. post(api.homePageLevelStatisticsByDept,{//病案首页
  261. "type": type||1//1月2年
  262. }).then((res)=>{
  263. let data = res.data;
  264. if(data.code == 0){
  265. let result1 = data.data||[]
  266. let dataX1=[],dataY1=[]
  267. for(let i = 0;i < result1.length;i++){
  268. dataX1.push(result1[i].doctorName)
  269. dataY1.push(result1[i].firstLevelPercentStr.replace('%',''))
  270. }
  271. lineChartSpecial(dataX1,dataY1)
  272. }
  273. })
  274. }
  275. }
  276. function lineChartSpecial(dataX,dataY){
  277. var myCharts = echarts.init(document.getElementById('lineChart'));
  278. var lengthNum = dataX.length;
  279. $(window).resize(function(){
  280. myCharts.resize()
  281. });
  282. option = {
  283. color: ['#37C4FC'],
  284. tooltip: {
  285. trigger: 'axis',
  286. position: 'right',
  287. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  288. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  289. }
  290. },
  291. grid: {
  292. left: '3%',
  293. right: '4%',
  294. bottom: '3%',
  295. containLabel: true
  296. },
  297. xAxis: [
  298. {
  299. type: 'category',
  300. data: dataX,
  301. axisTick: {
  302. alignWithLabel: true
  303. },
  304. axisLabel: {//x轴刻度
  305. textStyle: {
  306. color: '#E9EBEF'
  307. },
  308. rotate:45,
  309. formatter: function (value) {
  310. //x轴的文字改为竖版显示
  311. if(value.length>7){
  312. return value.slice(0,7)+'...'
  313. }
  314. return value;
  315. }
  316. },
  317. axisLine: {//x轴
  318. lineStyle:{
  319. color:'#4A5D8E'
  320. }
  321. }
  322. }
  323. ],
  324. yAxis: [
  325. {
  326. type: 'value',
  327. axisLine: {//y轴
  328. show: false
  329. },
  330. axisTick: {
  331. show: false
  332. },
  333. axisLabel: {//y轴刻度
  334. textStyle: {
  335. color: '#E9EBEF'
  336. }
  337. },
  338. splitLine:{//分割线
  339. lineStyle:{
  340. color:'#344876'
  341. }
  342. }
  343. }
  344. ],
  345. title:[{
  346. text: '合格率',
  347. top: 15,
  348. left: 10,
  349. textStyle: {
  350. fontSize: 14,
  351. color:'#fff',
  352. fontWeight: 400
  353. }
  354. }],
  355. series: [
  356. {
  357. name: '病案首页合格率',
  358. type: 'bar',
  359. barWidth: '23%',
  360. data: dataY
  361. }
  362. ]
  363. };
  364. myCharts.setOption(option);
  365. }
  366. //part01
  367. function personNum(data){
  368. $(".personNum").html("总人数:"+data['总人数'])
  369. $(".died").html(data['死亡人数'])
  370. $(".newborn").html(data['新生儿人数'])
  371. $(".patientNum").html(data['手术病人数'])
  372. }
  373. //part02
  374. function setNumDetail(data){
  375. // console.log(data,2222222222)
  376. if(data.length == 0){
  377. data = [
  378. {
  379. "id":null,
  380. "name":"累计质控病历数",
  381. "totleNum":0,
  382. "num":0,
  383. "percent":null,
  384. "percentStr":null
  385. },
  386. {
  387. "id":null,
  388. "name":"甲级病历",
  389. "totleNum":10,
  390. "num":0,
  391. "percent":0,
  392. "percentStr":"0.00%"
  393. },
  394. {
  395. "id":null,
  396. "name":"乙级病历",
  397. "totleNum":10,
  398. "num":0,
  399. "percent":0,
  400. "percentStr":"0.00%"
  401. },
  402. {
  403. "id":null,
  404. "name":"丙级病历",
  405. "totleNum":10,
  406. "num":0,
  407. "percent":0,
  408. "percentStr":"0.00%"
  409. }
  410. ]
  411. }
  412. let str = ''
  413. for(let i = 0;i < data.length;i++){
  414. str += `
  415. <li class="${i==0?'fst':i == data.length-1?' four':''}">
  416. <p class="numShow">${data[i].num}</p>
  417. <p class="explainNum">${data[i].name}</p>
  418. </li>
  419. `
  420. if(data[i].name == '甲级病历'){
  421. let tmp = []
  422. data[i].value = data[i].num
  423. tmp.push(data[i])
  424. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  425. part02pan(tmp,'fen01')
  426. }
  427. if(data[i].name == '乙级病历'){
  428. let tmp = []
  429. data[i].value = data[i].num
  430. tmp.push(data[i])
  431. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  432. part02pan(tmp,'fen02')
  433. }
  434. if(data[i].name == '丙级病历'){
  435. let tmp = []
  436. data[i].value = data[i].num
  437. tmp.push(data[i])
  438. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  439. part02pan(tmp,'fen03')
  440. }
  441. }
  442. $('.bingli').html(str)
  443. }
  444. //part02pan
  445. function part02pan(data,dom){
  446. // console.log(data,33333)
  447. dom = echarts.init(document.getElementById(dom));
  448. $(window).resize(function(){
  449. dom.resize()
  450. });
  451. let bgColor = '#fff';
  452. let title = '总量';
  453. let color = ['#3fffd1','#4c5c82'];
  454. let echartData = data;
  455. option = {
  456. // backgroundColor: bgColor,
  457. color: color,
  458. title: [{
  459. text:'{val|' + echartData[0].percentStr + '}',
  460. top: 'center',
  461. left: 'center',
  462. textStyle: {
  463. rich: {
  464. val: {
  465. fontSize: 14,
  466. color: '#E9EBEF',
  467. fontWeight: 'bold',
  468. padding: [10, 0]
  469. },
  470. name: {
  471. fontSize: 12,
  472. fontWeight: 'normal',
  473. color: '#E9EBEF',
  474. }
  475. }
  476. }
  477. }],
  478. series: [{
  479. name: '',
  480. type: 'pie',
  481. radius: ['70%', '90%'],
  482. data: echartData,
  483. hoverAnimation:true,
  484. hoverOffset:3,
  485. itemStyle: {
  486. normal: {
  487. borderColor: '#203463',
  488. borderWidth: 3
  489. }
  490. },
  491. label: {
  492. normal: {
  493. show:false,
  494. }
  495. },
  496. }]
  497. };
  498. dom.setOption(option);
  499. }
  500. //柱状图住院日期
  501. function emptyCircleB(data){
  502. if(!document.getElementById('emptyCircleB'))return
  503. var myChart = echarts.init(document.getElementById('emptyCircleB'));
  504. return
  505. $(window).resize(function(){
  506. myChart.resize()
  507. });
  508. let bgColor = '#fff';
  509. let title = '总量';
  510. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  511. let echartData = data;
  512. let total = 0;
  513. for(let i = 0;i < echartData.length;i++){
  514. total += echartData[i].num
  515. }
  516. option = {
  517. // backgroundColor: bgColor,
  518. color: color,
  519. title: [{
  520. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  521. top: 'center',
  522. left: 'center',
  523. textStyle: {
  524. rich: {
  525. val: {
  526. fontSize: 24,
  527. color: '#E9EBEF',
  528. fontWeight: 'bold',
  529. padding: [10, 0]
  530. },
  531. name: {
  532. fontSize: 12,
  533. fontWeight: 'normal',
  534. color: '#E9EBEF',
  535. }
  536. }
  537. }
  538. }],
  539. tooltip: {
  540. trigger: 'item',
  541. position: 'right',
  542. // formatter: '{b} : {c} ({d}%)',
  543. formatter:function(item){
  544. const {name, num, percentStr} = item.data
  545. return `${name} : ${num} (${percentStr})`
  546. }
  547. },
  548. series: [{
  549. name: '',
  550. type: 'pie',
  551. radius: ['70%', '90%'],
  552. data: echartData,
  553. hoverAnimation:true,
  554. hoverOffset:5,
  555. itemStyle: {
  556. normal: {
  557. // borderColor: bgColor,
  558. borderWidth: 3
  559. }
  560. },
  561. labelLine: {
  562. normal: {
  563. length: 20,
  564. length2: 120,
  565. lineStyle: {
  566. color: '#e6e6e6'
  567. }
  568. }
  569. },
  570. label: {
  571. normal: {
  572. show:false,
  573. formatter: params => {
  574. return params.name == 'A类'?params.name:''
  575. },
  576. padding: [0 , -100, 25, -100],
  577. rich: {
  578. icon: {
  579. fontSize: 16
  580. },
  581. name: {
  582. fontSize: 14,
  583. padding: [0, 10, 0, 4],
  584. color: '#666666'
  585. },
  586. value: {
  587. fontSize: 18,
  588. fontWeight: 'bold',
  589. color: '#333333'
  590. }
  591. }
  592. }
  593. },
  594. }]
  595. };
  596. myChart.setOption(option);
  597. }
  598. function emptyCircleBc(data){
  599. var myChart = echarts.init(document.getElementById('emptyCircleBc'));
  600. $(window).resize(function(){
  601. myChart.resize()
  602. });
  603. let bgColor = '#fff';
  604. let title = '总量';
  605. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  606. let echartData = data;
  607. let total = 0;
  608. for(let i = 0;i < echartData.length;i++){
  609. total += echartData[i].num
  610. }
  611. option = {
  612. // backgroundColor: bgColor,
  613. color: color,
  614. title: [{
  615. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  616. top: 'center',
  617. left: 'center',
  618. textStyle: {
  619. rich: {
  620. val: {
  621. fontSize: 24,
  622. color: '#E9EBEF',
  623. fontWeight: 'bold',
  624. padding: [10, 0]
  625. },
  626. name: {
  627. fontSize: 12,
  628. fontWeight: 'normal',
  629. color: '#E9EBEF',
  630. }
  631. }
  632. }
  633. }],
  634. tooltip: {
  635. trigger: 'item',
  636. position: 'right',
  637. // formatter: '{b} : {c} ({d}%)',
  638. formatter:function(item){
  639. const {name, num, percentStr} = item.data
  640. return `${name} : ${num} (${percentStr})`
  641. }
  642. },
  643. series: [{
  644. name: '',
  645. type: 'pie',
  646. radius: ['70%', '90%'],
  647. data: echartData,
  648. hoverAnimation:true,
  649. hoverOffset:5,
  650. itemStyle: {
  651. normal: {
  652. borderColor: '#203463',
  653. borderWidth: 3
  654. }
  655. },
  656. labelLine: {
  657. normal: {
  658. length: 20,
  659. length2: 120,
  660. lineStyle: {
  661. color: '#fff'
  662. }
  663. }
  664. },
  665. label: {
  666. normal: {
  667. show:false,
  668. formatter: params => {
  669. return params.name == 'A类'?params.name:''
  670. },
  671. padding: [0 , -100, 25, -100],
  672. rich: {
  673. icon: {
  674. fontSize: 16
  675. },
  676. name: {
  677. fontSize: 14,
  678. padding: [0, 10, 0, 4],
  679. color: '#fff'
  680. },
  681. value: {
  682. fontSize: 18,
  683. fontWeight: 'bold',
  684. color: '#fff'
  685. }
  686. }
  687. }
  688. },
  689. }]
  690. };
  691. myChart.setOption(option);
  692. }
  693. //缺陷列表渲染
  694. function queList(data){
  695. let strAll = '',tmp = `mm
  696. <tr class="thead">
  697. <td class="td01">排名</td>
  698. <td class="td02">缺陷详情</td>
  699. <td class="td03">数量</td>
  700. <td class="td04">占比</td>
  701. </tr>`
  702. for(let i = 0;i < data.length;i++){
  703. strAll += `
  704. <tr>
  705. <td style="text-align:center;"><i style="background:${i < 3?'#ECB22E':'#526186'};color:${i < 3?'#fff':'#B7BDCC'};">${i+1}</i></td>
  706. <td>${data[i].name}</td>
  707. <td>${data[i].num}</td>
  708. <td>${data[i].percentStr}</td>
  709. </tr>
  710. `
  711. }
  712. $(".qtable").html(tmp+strAll)
  713. }
  714. //饼图列表注释渲染
  715. function panDetailB(data){
  716. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  717. let strAll = '';
  718. for(let i = 0;i < data.length;i++){
  719. strAll += `
  720. <tr class="explainLi">
  721. <td class="deptName" title="${data[i].name}">
  722. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  723. </td>
  724. <td class="deptNum">${data[i].num}</td>
  725. <td class="percent">(${data[i].percentStr})</td>
  726. </tr>
  727. `
  728. }
  729. $(".explainPanB table").html(strAll);
  730. $(".explainPan").css({
  731. marginTop:-($(".explainPan").height()/2-20)+'px'
  732. })
  733. }
  734. function panDetailBc(data){
  735. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  736. let strAll = '';
  737. for(let i = 0;i < data.length;i++){
  738. strAll += `
  739. <tr class="explainLi">
  740. <td class="deptName" title="${data[i].name}">
  741. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  742. </td>
  743. <td class="deptNum">${data[i].num}</td>
  744. <td class="percent">(${data[i].percentStr})</td>
  745. </tr>
  746. `
  747. }
  748. $(".explainPanBc table").html(strAll);
  749. $(".explainPan").css({
  750. marginTop:-($(".explainPanc").height()/2-20)+'px'
  751. })
  752. }
  753. //时间获取
  754. function getTimeDetail(){
  755. const d = new Date();
  756. const days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
  757. let sec = d.getSeconds()
  758. let min = d.getMinutes()
  759. let hour = d.getHours()
  760. let str = `${d.getFullYear()}年${d.getMonth()+1}月${d.getDate()}日 / ${days[d.getDay()]} / ${hour>9?hour:'0'+hour}:${min>9?min:'0'+min}:${sec>9?sec:'0'+sec}`
  761. $(".dateDetail").html(str)
  762. }