deptConsole.js 25 KB

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