deptConsole.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  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. emptyCircleB(datafour[name])
  179. panDetailB(datafour[name])
  180. $(this).addClass("li0").siblings().removeClass("li0")
  181. })
  182. }
  183. //获取图表数据
  184. function getBarData(type){
  185. if(hasData('FUNC000054')){
  186. post(api.leaveHosCountByDept,{//出院人数统计
  187. "type": type||1//1月2年
  188. }).then((res)=>{
  189. let data = res.data;
  190. if(data.code == 0){
  191. let result = data.data[curDept]||[]
  192. datafst = data.data
  193. personNum(result)
  194. }
  195. })
  196. }
  197. if(hasData('FUNC000055')){
  198. post(api.mrCountByDept,{//质控病历统计
  199. "type": type||1//1月2年
  200. }).then((res)=>{
  201. let data = res.data
  202. if(data.code == 0){
  203. let result3 = data.data[curDept]||[]
  204. datasec = data.data
  205. setNumDetail(result3)
  206. }
  207. })
  208. }
  209. if(hasData('FUNC000056')){
  210. post(api.entryCountGroupByCaseAndDept,{//各模块缺陷占比排行
  211. "type": type||1//1月2年
  212. }).then((res)=>{
  213. let data = res.data;
  214. if(data.code == 0){
  215. let result1 = data.data[curDept]||[]
  216. datatrd = data.data
  217. queList(result1)
  218. }
  219. })
  220. }
  221. if(hasData('FUNC000057')){
  222. if(hospital=="台州市立"){
  223. post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
  224. "type": type||1//1月2年
  225. }).then((res)=>{
  226. let data = res.data;
  227. if(data.code == 0){
  228. let result3 = data.data[curDept]||[]
  229. for(let i = 0;i < result3.length;i++){
  230. result3[i].value = result3[i].num
  231. }
  232. datafour = data.data
  233. emptyCircleB(result3)
  234. panDetailB(result3)
  235. }
  236. })
  237. }else{
  238. post(api.entryCountGroupByEntryAndDept,{//条目缺陷占比
  239. "type": type||1//1月2年
  240. }).then((res)=>{
  241. let data = res.data;
  242. if(data.code == 0){
  243. let result3 = data.data[curDept]||[]
  244. for(let i = 0;i < result3.length;i++){
  245. result3[i].value = result3[i].num
  246. }
  247. datafour = data.data
  248. emptyCircleBc(result3)
  249. panDetailBc(result3)
  250. }
  251. })
  252. }
  253. }
  254. if(hospital=="长兴医院"&&hasData("FUNC000076")){
  255. post(api.getAverageScore,{//病案首页
  256. "type": type||1//1月2年
  257. }).then((res)=>{
  258. let data = res.data;
  259. if(data.code == 0){
  260. let result1 = data.data['各科室质控平均分']||[]
  261. let dataX1=[],dataY1=[]
  262. for(let i = 0;i < result1.length;i++){
  263. dataX1.push(result1[i].name)
  264. dataY1.push(result1[i].averageValue)
  265. }
  266. lineChartSpecial(dataX1,dataY1)
  267. }
  268. })
  269. }
  270. }
  271. function lineChartSpecial(dataX,dataY){
  272. var myCharts = echarts.init(document.getElementById('lineChart'));
  273. var lengthNum = dataX.length;
  274. $(window).resize(function(){
  275. myCharts.resize()
  276. });
  277. option = {
  278. color: ['#37C4FC'],
  279. tooltip: {
  280. trigger: 'axis',
  281. position: 'right',
  282. axisPointer: { // 坐标轴指示器,坐标轴触发有效
  283. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  284. }
  285. },
  286. grid: {
  287. left: '3%',
  288. right: '4%',
  289. bottom: '3%',
  290. containLabel: true
  291. },
  292. xAxis: [
  293. {
  294. type: 'category',
  295. data: dataX,
  296. axisTick: {
  297. alignWithLabel: true
  298. },
  299. axisLabel: {//x轴刻度
  300. textStyle: {
  301. color: '#E9EBEF'
  302. },
  303. rotate:45,
  304. formatter: function (value) {
  305. //x轴的文字改为竖版显示
  306. if(value.length>7){
  307. return value.slice(0,7)+'...'
  308. }
  309. return value;
  310. }
  311. },
  312. axisLine: {//x轴
  313. lineStyle:{
  314. color:'#4A5D8E'
  315. }
  316. }
  317. }
  318. ],
  319. yAxis: [
  320. {
  321. type: 'value',
  322. axisLine: {//y轴
  323. show: false
  324. },
  325. axisTick: {
  326. show: false
  327. },
  328. axisLabel: {//y轴刻度
  329. textStyle: {
  330. color: '#E9EBEF'
  331. }
  332. },
  333. splitLine:{//分割线
  334. lineStyle:{
  335. color:'#344876'
  336. }
  337. }
  338. }
  339. ],
  340. title:[{
  341. text: '合格率',
  342. top: 15,
  343. left: 10,
  344. textStyle: {
  345. fontSize: 14,
  346. color:'#fff',
  347. fontWeight: 400
  348. }
  349. }],
  350. series: [
  351. {
  352. name: '质控平均分',
  353. type: 'bar',
  354. barWidth: '23%',
  355. data: dataY
  356. }
  357. ]
  358. };
  359. myCharts.setOption(option);
  360. }
  361. //part01
  362. function personNum(data){
  363. $(".personNum").html("总人数:"+data['总人数'])
  364. $(".died").html(data['死亡人数'])
  365. $(".newborn").html(data['新生儿人数'])
  366. $(".patientNum").html(data['手术病人数'])
  367. }
  368. //part02
  369. function setNumDetail(data){
  370. // console.log(data,2222222222)
  371. if(data.length == 0){
  372. data = [
  373. {
  374. "id":null,
  375. "name":"累计质控病历数",
  376. "totleNum":0,
  377. "num":0,
  378. "percent":null,
  379. "percentStr":null
  380. },
  381. {
  382. "id":null,
  383. "name":"甲级病历",
  384. "totleNum":10,
  385. "num":0,
  386. "percent":0,
  387. "percentStr":"0.00%"
  388. },
  389. {
  390. "id":null,
  391. "name":"乙级病历",
  392. "totleNum":10,
  393. "num":0,
  394. "percent":0,
  395. "percentStr":"0.00%"
  396. },
  397. {
  398. "id":null,
  399. "name":"丙级病历",
  400. "totleNum":10,
  401. "num":0,
  402. "percent":0,
  403. "percentStr":"0.00%"
  404. }
  405. ]
  406. }
  407. let str = ''
  408. for(let i = 0;i < data.length;i++){
  409. str += `
  410. <li class="${i==0?'fst':i == data.length-1?' four':''}">
  411. <p class="numShow">${data[i].num}</p>
  412. <p class="explainNum">${data[i].name}</p>
  413. </li>
  414. `
  415. if(data[i].name == '甲级病历'){
  416. let tmp = []
  417. data[i].value = data[i].num
  418. tmp.push(data[i])
  419. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  420. part02pan(tmp,'fen01')
  421. }
  422. if(data[i].name == '乙级病历'){
  423. let tmp = []
  424. data[i].value = data[i].num
  425. tmp.push(data[i])
  426. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  427. part02pan(tmp,'fen02')
  428. }
  429. if(data[i].name == '丙级病历'){
  430. let tmp = []
  431. data[i].value = data[i].num
  432. tmp.push(data[i])
  433. tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
  434. part02pan(tmp,'fen03')
  435. }
  436. }
  437. $('.bingli').html(str)
  438. }
  439. //part02pan
  440. function part02pan(data,dom){
  441. // console.log(data,33333)
  442. dom = echarts.init(document.getElementById(dom));
  443. $(window).resize(function(){
  444. dom.resize()
  445. });
  446. let bgColor = '#fff';
  447. let title = '总量';
  448. let color = ['#37CBCB','#dedede'];
  449. let echartData = data;
  450. option = {
  451. // backgroundColor: bgColor,
  452. color: color,
  453. title: [{
  454. text:'{val|' + echartData[0].percentStr + '}',
  455. top: 'center',
  456. left: 'center',
  457. textStyle: {
  458. rich: {
  459. val: {
  460. fontSize: 14,
  461. color: '#fff',
  462. fontWeight: 'bold',
  463. padding: [10, 0]
  464. },
  465. name: {
  466. fontSize: 12,
  467. fontWeight: 'normal',
  468. color: '#fff',
  469. }
  470. }
  471. }
  472. }],
  473. series: [{
  474. name: '',
  475. type: 'pie',
  476. radius: ['70%', '90%'],
  477. data: echartData,
  478. hoverAnimation:false,
  479. label: {
  480. normal: {
  481. show:false,
  482. }
  483. },
  484. }]
  485. };
  486. dom.setOption(option);
  487. }
  488. //柱状图住院日期
  489. function emptyCircleB(data){
  490. if(!document.getElementById('emptyCircleB'))return
  491. var myChart = echarts.init(document.getElementById('emptyCircleB'));
  492. return
  493. $(window).resize(function(){
  494. myChart.resize()
  495. });
  496. let bgColor = '#fff';
  497. let title = '总量';
  498. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  499. let echartData = data;
  500. let total = 0;
  501. for(let i = 0;i < echartData.length;i++){
  502. total += echartData[i].num
  503. }
  504. option = {
  505. // backgroundColor: bgColor,
  506. color: color,
  507. title: [{
  508. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  509. top: 'center',
  510. left: 'center',
  511. textStyle: {
  512. rich: {
  513. val: {
  514. fontSize: 24,
  515. color: '#fff',
  516. fontWeight: 'bold',
  517. padding: [10, 0]
  518. },
  519. name: {
  520. fontSize: 12,
  521. fontWeight: 'normal',
  522. color: '#fff',
  523. }
  524. }
  525. }
  526. }],
  527. tooltip: {
  528. trigger: 'item',
  529. position: 'right',
  530. // formatter: '{b} : {c} ({d}%)',
  531. formatter:function(item){
  532. const {name, num, percentStr} = item.data
  533. return `${name} : ${num} (${percentStr})`
  534. }
  535. },
  536. series: [{
  537. name: '',
  538. type: 'pie',
  539. radius: ['70%', '90%'],
  540. data: echartData,
  541. hoverAnimation:true,
  542. hoverOffset:5,
  543. itemStyle: {
  544. normal: {
  545. // borderColor: bgColor,
  546. borderWidth: 2
  547. }
  548. },
  549. labelLine: {
  550. normal: {
  551. length: 20,
  552. length2: 120,
  553. lineStyle: {
  554. color: '#e6e6e6'
  555. }
  556. }
  557. },
  558. label: {
  559. normal: {
  560. show:false,
  561. formatter: params => {
  562. return params.name == 'A类'?params.name:''
  563. },
  564. padding: [0 , -100, 25, -100],
  565. rich: {
  566. icon: {
  567. fontSize: 16
  568. },
  569. name: {
  570. fontSize: 14,
  571. padding: [0, 10, 0, 4],
  572. color: '#666666'
  573. },
  574. value: {
  575. fontSize: 18,
  576. fontWeight: 'bold',
  577. color: '#333333'
  578. }
  579. }
  580. }
  581. },
  582. }]
  583. };
  584. myChart.setOption(option);
  585. }
  586. function emptyCircleBc(data){
  587. var myChart = echarts.init(document.getElementById('emptyCircleBc'));
  588. $(window).resize(function(){
  589. myChart.resize()
  590. });
  591. let bgColor = '#fff';
  592. let title = '总量';
  593. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  594. let echartData = data;
  595. let total = 0;
  596. for(let i = 0;i < echartData.length;i++){
  597. total += echartData[i].num
  598. }
  599. option = {
  600. // backgroundColor: bgColor,
  601. color: color,
  602. title: [{
  603. text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
  604. top: 'center',
  605. left: 'center',
  606. textStyle: {
  607. rich: {
  608. val: {
  609. fontSize: 24,
  610. color: '#fff',
  611. fontWeight: 'bold',
  612. padding: [10, 0]
  613. },
  614. name: {
  615. fontSize: 12,
  616. fontWeight: 'normal',
  617. color: '#fff',
  618. }
  619. }
  620. }
  621. }],
  622. tooltip: {
  623. trigger: 'item',
  624. position: 'right',
  625. // formatter: '{b} : {c} ({d}%)',
  626. formatter:function(item){
  627. const {name, num, percentStr} = item.data
  628. return `${name} : ${num} (${percentStr})`
  629. }
  630. },
  631. series: [{
  632. name: '',
  633. type: 'pie',
  634. radius: ['70%', '90%'],
  635. data: echartData,
  636. hoverAnimation:true,
  637. hoverOffset:5,
  638. itemStyle: {
  639. normal: {
  640. // borderColor: bgColor,
  641. borderWidth: 2
  642. }
  643. },
  644. labelLine: {
  645. normal: {
  646. length: 20,
  647. length2: 120,
  648. lineStyle: {
  649. color: '#fff'
  650. }
  651. }
  652. },
  653. label: {
  654. normal: {
  655. show:false,
  656. formatter: params => {
  657. return params.name == 'A类'?params.name:''
  658. },
  659. padding: [0 , -100, 25, -100],
  660. rich: {
  661. icon: {
  662. fontSize: 16
  663. },
  664. name: {
  665. fontSize: 14,
  666. padding: [0, 10, 0, 4],
  667. color: '#fff'
  668. },
  669. value: {
  670. fontSize: 18,
  671. fontWeight: 'bold',
  672. color: '#fff'
  673. }
  674. }
  675. }
  676. },
  677. }]
  678. };
  679. myChart.setOption(option);
  680. }
  681. //缺陷列表渲染
  682. function queList(data){
  683. let strAll = '',tmp = `mm
  684. <tr class="thead">
  685. <td class="td01">排名</td>
  686. <td class="td02">缺陷详情</td>
  687. <td class="td03">数量</td>
  688. <td class="td04">占比</td>
  689. </tr>`
  690. for(let i = 0;i < data.length;i++){
  691. strAll += `
  692. <tr>
  693. <td style="text-align:center;"><i style="background:${i < 3?'#ECB22E':'#526186'};color:${i < 3?'#fff':'#B7BDCC'};">${i+1}</i></td>
  694. <td>${data[i].name}</td>
  695. <td>${data[i].num}</td>
  696. <td>${data[i].percentStr}</td>
  697. </tr>
  698. `
  699. }
  700. $(".qtable").html(tmp+strAll)
  701. }
  702. //饼图列表注释渲染
  703. function panDetailB(data){
  704. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  705. let strAll = '';
  706. for(let i = 0;i < data.length;i++){
  707. strAll += `
  708. <tr class="explainLi">
  709. <td class="deptName" title="${data[i].name}">
  710. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  711. </td>
  712. <td class="deptNum">${data[i].num}</td>
  713. <td class="percent">(${data[i].percentStr})</td>
  714. </tr>
  715. `
  716. }
  717. $(".explainPanB table").html(strAll);
  718. $(".explainPan").css({
  719. marginTop:-($(".explainPan").height()/2-20)+'px'
  720. })
  721. }
  722. function panDetailBc(data){
  723. let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
  724. let strAll = '';
  725. for(let i = 0;i < data.length;i++){
  726. strAll += `
  727. <tr class="explainLi">
  728. <td class="deptName" title="${data[i].name}">
  729. <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
  730. </td>
  731. <td class="deptNum">${data[i].num}</td>
  732. <td class="percent">(${data[i].percentStr})</td>
  733. </tr>
  734. `
  735. }
  736. $(".explainPanBc table").html(strAll);
  737. $(".explainPan").css({
  738. marginTop:-($(".explainPanc").height()/2-20)+'px'
  739. })
  740. }
  741. //时间获取
  742. function getTimeDetail(){
  743. const d = new Date();
  744. const days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
  745. let sec = d.getSeconds()
  746. let min = d.getMinutes()
  747. let hour = d.getHours()
  748. 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}`
  749. $(".dateDetail").html(str)
  750. }