deptConsole.js 27 KB

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