123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197 |
- const $ = require('jquery');
- require("../css/reset.less")
- require("../css/console.less")
- require("../images/logo.png")
- require("../images/arrow_down.png")
- // import 'zrender/lib/svg/svg';
- const {api} = require('./api.js')
- const echarts = require('echarts');
- const {post,setCookie,delCookie,getCookie} = require('../js/utils.js');
- let payMoney = [],dayLis = [],dateType = 2,slideType = 1,hospital=getCookie("hospital");
- $(function(){
- if(!hasData('YH-KZT')){
- $("body").html('')
- }
- if(hospital == "台州市立"){
- $(".part03 .partTitlePub .name").html('各科室甲级病例占比')
- }else{
- $(".part03 .partTitlePub .name").html('病案首页合格率')
- }
- $(".partTitle p span").html(hospital)
- setInterval(() => {
- getTimeDetail()
- }, 1000);
- resizeBox()
- initConsole()//质控列表
- getBarData(2)//图标数据获取
- dateChange()
- $(window).click(function(){
- window.parent.userActionHide()
- $(".toggleSlide ul").css("display","none")
- })
- let sildeIS = true
- if(!hasData('FUNC000045')&&!hasData('FUNC000046')){
- $(".toggleSlide").css("opacity","0.5")
- sildeIS = false
- }
- $(".toggleSlide p").click(function(e){
- if(!sildeIS)return
- e.stopPropagation()
- $(this).next().slideToggle()
- })
- $(".toggleSlide li").click(function(){
- let str = $(this).attr("data-str"),type = $(this).attr("data-type")
- if(type == 1){
- if(!hasData('FUNC000045')){
- return
- }
- slideType = 1
- $(".pubEchart .title").html("科室平均住院天数柱状图")
- barChart(dayLis,dateType)
- }else{
- if(!hasData('FUNC000046')){
- return
- }
- slideType = 2
- $(".pubEchart .title").html("科室平均住院花费柱状图")
- barChart(payMoney,dateType)
- }
- $(this).parent().slideToggle().prev().find("span").html(str)
- })
- getDetails()
- })
- function getDetails(){
- $(".part02 .bingli,.part02 .bingliLis,.part03 .circle .title,.pubEchartB.paymoney .title").click(function(){
- $(parent.document).find("#contentIframe").attr("src","deptScoreDetailControl.html")
- })
- $(".part03 .partTitlePub").click(function(){
- $(parent.document).find("#contentIframe").attr("src",hospital=="台州市立"?"jiaji.html":"partDetailControl.html")
- })
- $(".paymoney.pubEchart .title").click(function(){
- $(parent.document).find("#contentIframe").attr("src","dayDetail.html")
- })
- $(".defect .partTitlePub").click(function(){//from 1 console / 2 deptConsole
- $(parent.document).find("#contentIframe").attr("src","mukuai.html?from=1&dateType="+dateType)
- })
- $(".circleB .title").click(function(){
- $(parent.document).find("#contentIframe").attr("src","tiaomu.html?from=1&dateType="+dateType)
- })
- }
- //判断有无某一权限
- function hasData(data){
- let lis = JSON.parse(getCookie("codeLis"))
- // console.log(lis)
- if(lis.indexOf(data)>-1){//有权限
- return true
- }
- return false;
- }
- function resizeBox(){
- $(".partWrap").css({
- height:$(window).height()-38+'px'
- })
- }
- //所有数据切换日期筛选
- function dateChange(){
- $(".monthYear .mon").click(function(){
- $(this).css({
- backgroundColor:'#5A8EEE',
- color:'#fff'
- }).siblings().css({
- color:'#5A8EEE',
- backgroundColor:'#fff'
- })
- dateType = 1
- getBarData(1)
- })
- $(".monthYear .year").click(function(){
- $(this).css({
- backgroundColor:'#5A8EEE',
- color:'#fff'
- }).siblings().css({
- color:'#5A8EEE',
- backgroundColor:'#fff'
- })
- dateType = 2
- getBarData(2)
- })
- }
- //控制台数
- function initConsole(result){
- let url = {
- '本月病历数':require("../images/icon6.png"),
- '本月不合格病历-机器':require("../images/icon7.png"),
- '本月质控数-机器':require("../images/icon10.png"),
- '本月甲级病历-机器':require("../images/icon8.png"),
- '本月乙级病历-机器':require("../images/icon9.png"),
- '本年病历数':require("../images/icon6.png"),
- '本年不合格病历-机器':require("../images/icon7.png"),
- '本年质控数-机器':require("../images/icon10.png"),
- '本年甲级病历-机器':require("../images/icon8.png"),
- '本年乙级病历-机器':require("../images/icon9.png"),
- }
- let dom = '';
- for(let i in result){
- if(i.indexOf("人工")==-1){
- let name = i.split("-")[0];
- let num = 0;
- if(name=='本月病历数'||name=='本年病历数'){
- num = result[i]
- }else{
- num = result[name+'-人工']+result[i]
- }
- dom += `
- <li class="partLi">
- <div class="partIn">
- <p class="top">${name}</p>
- <p class="btm clearfix">
- <img src="${url[i]}" alt="">
- <span>${num}</span>
- </p>
- </div>
- </li>
- `
- }
- }
- $(".partAll").html(dom)
- }
- //获取图表数据
- function getBarData(type){
- if(hasData('FUNC000045')){
- post(api.getAverageDayNum,{//平均住院天数
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result2 = data.data['平均住院日']||[]
- dayLis = result2
- if(slideType == 1){
- barChart(result2,type||1)
- }
- }
- })
- }else{
- $(".toggleSlide1").css("opacity",0.5)
- }
- if(hasData('FUNC000046')){
- post(api.getAverageFee,{//平均住院费用
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result3 = data.data['平均住院费用']||[]
- payMoney = result3;
- if(slideType == 2){
- barChart(result3,type||1)
- }
- }
- })
- }else{
- $(".toggleSlide2").css("opacity",0.5)
- }
- if(hasData('FUNC000047')){
- post(api.getAverageScore,{//各科室质控平均分
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result1 = data.data['各科室质控平均分']||[]
- let dataX1=[],dataY1=[]
- for(let i = 0;i < result1.length;i++){
- dataX1.push(result1[i].name)
- dataY1.push(result1[i].averageValue)
- }
- barChartPay(dataX1,dataY1)
- }
- })
- }
- if(hasData('FUNC000048')&&hospital=="台州市立"){
- post(api.getLevelResultDept,{//各科室甲级占比
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result2 = data.data['各科室甲级病历占比']||[]
- let dataX2=[],dataY2=[];
- for(let i = 0;i < result2.length;i++){
- dataX2.push(result2[i].deptName)
- dataY2.push(result2[i].firstPercent.replace('%',''))
- }
- lineChart(dataX2,dataY2)
- }
- })
- }
- if(hasData('FUNC000075')&&hospital=="长兴医院"){
- post(api.homePageLevelLimit,{//病案首页
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result1 = data.data||[]
- let dataX1=[],dataY1=[]
- for(let i = 0;i < result1.length;i++){
- dataX1.push(result1[i].deptName)
- dataY1.push(result1[i].firstLevelPercentStr.replace('%',''))
- }
- lineChartSpecial(dataX1,dataY1)
- }
- })
- }
- if(hasData('FUNC000049')){
- post(api.leaveHosCount,{//出院人数统计
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- // barChart(result2,type||1)
- // console.log(data)
- let result1 = data.data['出院人数统计']||[]
- personNum(result1)
- }
- })
- }
- if(hasData('FUNC000050')){
- post(api.mrCount,{//质控病历统计
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data
- if(data.code == 0){
- let result3 = data.data['病历数统计']||[]
- if(result3.length == 0){
- result3 = [
- {
- "id":null,
- "name":"累计质控病历数",
- "totleNum":0,
- "num":0,
- "percent":null,
- "percentStr":null
- },
- {
- "id":null,
- "name":"甲级病历",
- "totleNum":10,
- "num":0,
- "percent":0,
- "percentStr":"0.00%"
- },
- {
- "id":null,
- "name":"乙级病历",
- "totleNum":10,
- "num":0,
- "percent":0,
- "percentStr":"0.00%"
- },
- {
- "id":null,
- "name":"丙级病历",
- "totleNum":10,
- "num":0,
- "percent":0,
- "percentStr":"0.00%"
- }
- ]
- }
- setNumDetail(result3)
- }
- })
- }
- if(hasData('FUNC000051')){
- post(api.entryCountGroupByCase,{//各模块缺陷占比排行
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result1 = data.data['各模块缺陷占比排行']||[]
- queList(result1)
- }
- })
- }
- if(hasData('FUNC000052')){
- post(api.entryCountGroupByEntry,{//条目缺陷占比
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result3 = data.data['条目缺陷占比']||[]
- for(let i = 0;i < result3.length;i++){
- result3[i].value = result3[i].num
- }
- emptyCircleB(result3)
- panDetailB(result3)
- }
- })
- }
- if(hasData('FUNC000053')){
- post(api.entryByDept,{//各科室缺陷占比
- "type": type||1//1月2年
- }).then((res)=>{
- let data = res.data;
- if(data.code == 0){
- let result2 = data.data['各科室缺陷占比']||[]
- for(let i = 0;i < result2.length;i++){
- result2[i].value = result2[i].num
- }
- emptyCircle(result2)
- panDetail(result2)
- }
- })
- }
- }
- //part01
- function personNum(data){
- $(".personNum").html("总人数:"+data['总人数'])
- $(".died").html(data['死亡人数'])
- $(".newborn").html(data['新生儿人数'])
- $(".patientNum").html(data['手术病人数'])
- }
- //part02
- function setNumDetail(data){
- // console.log(data,2222222222)
- if(data.length == 0)return
- let str = ''
- for(let i = 0;i < data.length;i++){
- str += `
- <li class="${i==0?'fst':''}">
- <p class="numShow">${data[i].num}</p>
- <p class="explainNum">${data[i].name}</p>
- </li>
- `
- if(data[i].name == '甲级病历'){
- let tmp = []
- data[i].value = data[i].num
- tmp.push(data[i])
- tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
- part02pan(tmp,'fen01')
- }
- if(data[i].name == '乙级病历'){
- let tmp = []
- data[i].value = data[i].num
- tmp.push(data[i])
- tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
- part02pan(tmp,'fen02')
- }
- if(data[i].name == '丙级病历'){
- let tmp = []
- data[i].value = data[i].num
- tmp.push(data[i])
- tmp.push({percentStr:(1-data[i].percent)*100+'%',value:data[i].totleNum - data[i].num})
- part02pan(tmp,'fen03')
- }
- }
- $('.bingli').html(str)
- }
- //part02pan
- function part02pan(data,dom){
- // console.log(data,33333)
- dom = echarts.init(document.getElementById(dom));
- $(window).resize(function(){
- dom.resize()
- });
- let bgColor = '#fff';
- let title = '总量';
- let color = ['#37CBCB','#dedede'];
- let echartData = data;
- option = {
- backgroundColor: bgColor,
- color: color,
- title: [{
- text:'{val|' + echartData[0].percentStr + '}',
- top: 'center',
- left: 'center',
- textStyle: {
- rich: {
- val: {
- fontSize: 14,
- color: '#333',
- fontWeight: 'bold',
- padding: [10, 0]
- },
- name: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#777',
- }
- }
- }
- }],
- series: [{
- name: '',
- type: 'pie',
- radius: ['70%', '90%'],
- data: echartData,
- hoverAnimation:false,
- label: {
- normal: {
- show:false,
- }
- },
- }]
- };
- dom.setOption(option);
- }
- //折现图
- function lineChart(dataX,dataY){
- var myCharts = echarts.init(document.getElementById('lineChart'));
- $(window).resize(function(){
- myCharts.resize()
- });
- option = {
- color:"#5A8EEE",
- tooltip: {
- trigger: 'axis',
- color:'#fff',
- formatter: function(param) {
- return '<div style="color:#fff;"> '+ param[0].name + "<br>" +"甲级病历占比:"+ param[0].value+"%" + "<br>"
- '</div>'
- }
- },
- grid: {
- left: '3%',
- right: '5%',
- bottom: '3%',
- containLabel: true
- },
- title:[{
- text: dataX.length>0?'百分比':'',
- top: 15,
- left: 0,
- textStyle: {
- fontSize: 14,
- color:'#666666',
- fontWeight: 400
- }
- }],
- toolbox: {
- show: false,
- feature: {
- dataZoom: {
- yAxisIndex: 'none'
- },
- dataView: {readOnly: false},
- magicType: {type: ['line', 'bar']},
- restore: {
- },
- saveAsImage: {}
- },
- emphasis:{
- iconStyle:{
- color:'red'
- }
- },
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data: dataX,
- axisLabel: {//x轴刻度
- textStyle: {
- color: '#333'
- },
- rotate:'45',
- formatter: function (value) {
- //x轴的文字改为竖版显示
- if(value.length>7){
- return value.slice(0,7)+'...'
- }
- return value;
- }
- },
- axisLine: {//x轴
- lineStyle:{
- color:'#AAAAAA'
- }
- }
- },
- yAxis: {
- type: 'value',
- axisLabel: {
- formatter: '{value} %',
- textStyle: {
- color: '#333333'
- }
- },
-
- axisLine: {//y轴
- show: false
- },
- axisTick: {
- show: false
- },
- splitLine:{//分割线
- lineStyle:{
- color:'#EFF3FC'
- }
- }
- },
- series: [
- {
- name: '甲级病历占比:',
- type: 'line',
- data: dataY,
- }
- ]
- };
- myCharts.setOption(option);
- }
- function lineChartSpecial(dataX,dataY){
- var myCharts = echarts.init(document.getElementById('lineChart'));
- var lengthNum = dataX.length;
- $(window).resize(function(){
- myCharts.resize()
- });
- option = {
- color: ['#3398DB'],
- tooltip: {
- trigger: 'axis',
- position: 'right',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: dataX,
- axisTick: {
- alignWithLabel: true
- },
- axisLabel: {//x轴刻度
- textStyle: {
- color: '#333'
- },
- rotate:45,
- formatter: function (value) {
- //x轴的文字改为竖版显示
- if(value.length>7){
- return value.slice(0,7)+'...'
- }
- return value;
- }
- },
- axisLine: {//x轴
- lineStyle:{
- color:'#AAAAAA'
- }
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- axisLine: {//y轴
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {//y轴刻度
- textStyle: {
- color: '#333333'
- }
- },
- splitLine:{//分割线
- lineStyle:{
- color:'#EFF3FC'
- }
- }
- }
-
- ],
- title:[{
- text: '合格率',
- top: 15,
- left: 10,
- textStyle: {
- fontSize: 14,
- color:'#666666',
- fontWeight: 400
- }
- }],
- series: [
- {
- name: '质控平均分',
- type: 'bar',
- barWidth: '23%',
- data: dataY
- }
- ]
- };
- myCharts.setOption(option);
- }
- //柱状图住院费用
- function barChartPay(dataX,dataY){
- var myCharts = echarts.init(document.getElementById('barChartPay'));
- var lengthNum = dataX.length;
- $(window).resize(function(){
- myCharts.resize()
- });
- option = {
- color: ['#3398DB'],
- tooltip: {
- trigger: 'axis',
- position: 'right',
- axisPointer: { // 坐标轴指示器,坐标轴触发有效
- type: 'line' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- data: dataX,
- axisTick: {
- alignWithLabel: true
- },
- axisLabel: {//x轴刻度
- textStyle: {
- color: '#333'
- },
- rotate:45,
- formatter: function (value) {
- //x轴的文字改为竖版显示
- if(value.length>7){
- return value.slice(0,7)+'...'
- }
- return value;
- }
- },
- axisLine: {//x轴
- lineStyle:{
- color:'#AAAAAA'
- }
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- axisLine: {//y轴
- show: false
- },
- axisTick: {
- show: false
- },
- axisLabel: {//y轴刻度
- textStyle: {
- color: '#333333'
- }
- },
- splitLine:{//分割线
- lineStyle:{
- color:'#EFF3FC'
- }
- }
- }
-
- ],
- title:[{
- text: '分数',
- top: 15,
- left: 10,
- textStyle: {
- fontSize: 14,
- color:'#666666',
- fontWeight: 400
- }
- }],
- series: [
- {
- name: '质控平均分',
- type: 'bar',
- barWidth: '23%',
- data: dataY
- }
- ]
- };
- myCharts.setOption(option);
- }
- //柱状图住院日期
- function barChart(data,type){
- // console.log(data,type)
- var myChart = echarts.init(document.getElementById('barChart'));
- $(window).resize(function(){
- myChart.resize()
- });
- var posList = [
- 'left', 'right', 'top', 'bottom',
- 'inside',
- 'insideTop', 'insideLeft', 'insideRight', 'insideBottom',
- 'insideTopLeft', 'insideTopRight', 'insideBottomLeft', 'insideBottomRight'
- ];
- let app = {}
- app.configParameters = {
- rotate: {
- min: -90,
- max: 90
- },
- align: {
- options: {
- left: 'left',
- center: 'center',
- right: 'right'
- }
- },
- verticalAlign: {
- options: {
- top: 'top',
- middle: 'middle',
- bottom: 'bottom'
- }
- },
- position: {
- options: echarts.util.reduce(posList, function (map, pos) {
- map[pos] = pos;
- return map;
- }, {})
- },
- distance: {
- min: 0,
- max: 100
- }
- };
- app.config = {
- rotate: 90,
- align: 'left',
- verticalAlign: 'middle',
- position: 'insideBottom',
- distance: 15,
- onChange: function () {
- var labelOption = {
- normal: {
- rotate: app.config.rotate,
- align: app.config.align,
- verticalAlign: app.config.verticalAlign,
- position: app.config.position,
- distance: app.config.distance
- }
- };
- myChart.setOption({
- series: [{
- label: labelOption
- }, {
- label: labelOption
- }, {
- label: labelOption
- }, {
- label: labelOption
- }]
- });
- }
- };
- var labelOption = {
- show: false,
- position: app.config.position,
- distance: app.config.distance,
- align: app.config.align,
- verticalAlign: app.config.verticalAlign,
- rotate: app.config.rotate,
- formatter: '{c} {name|{a}}',
- fontSize: 12,
- rich: {
- name: {
- textBorderColor: '#fff'
- }
- }
- };
- let dataX = []
- let data1 = []
- let data2 = []
- let data3 = []
- for(let i = 0;i < data.length;i++){
- dataX.push(data[i].name)
- data1.push(data[i].averageValue)//本月
- data2.push(data[i].lastAverageValue)//本年
- data3.push(data[i].lastYearAverageValue)//去年本月
- }
- option = {
- color: ['#5A8EEE', '#FAD336', '#37CBCB'],
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'shadow'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- title:[{
- text: slideType==1?'天数':'元',
- top: 15,
- left: 10,
- textStyle: {
- fontSize: 14,
- color:'#666666',
- fontWeight: 400
- }
- }],
- legend: {
- itemWidth :10,
- itemHeight :10,
- right:15,
- top:15,
- selectedMode:false,
- formatter: function (name) {
- return name;
- }
- },
- toolbox: {
- show: false,
- orient: 'vertical',
- left: 'right',
- top: 'center',
- feature: {
- mark: {show: true},
- dataView: {show: true, readOnly: false},
- magicType: {show: true, type: ['line', 'bar', 'stack', 'tiled']},
- restore: {show: true},
- saveAsImage: {show: true}
- }
- },
- xAxis: [
- {
- type: 'category',
- axisTick: {show: false},
- data: dataX,
- axisLabel: {//x轴刻度
- textStyle: {
- color: '#333'
- },
- rotate:'45',
- formatter: function (value) {
- //x轴的文字改为竖版显示
- if(value.length>7){
- return value.slice(0,7)+'...'
- }
- return value;
- }
- },
- axisLine: {//x轴
- lineStyle:{
- color:'#AAAAAA'
- }
- },
- }
- ],
- yAxis: [
- {
- type: 'value',
- axisLine: {//y轴
- show: false
- },
- axisTick: {
- show: false
- },
- splitLine:{//分割线
- lineStyle:{
- color:'#EFF3FC'
- }
- }
- }
- ],
- series: [
- {
- name: type==1?'上月':'',
- type: 'bar',
- barGap: 0,
- label: labelOption,
- barWidth: '15%',
- data: type==1?data2:[]
- },
- {
- name: type==1?'去年本月':'去年',
- type: 'bar',
- label: labelOption,
- barWidth: '15%',
- data: data3
- },
- {
- name: type==1?'本月':'本年',
- type: 'bar',
- label: labelOption,
- barWidth: '15%',
- data: data1
- }
- ]
- };
- myChart.setOption(option);
- }
- //空心饼图
- function emptyCircle(data){
- // console.log(data,1111111111)
- var myChart = echarts.init(document.getElementById('emptyCircle'));
- $(window).resize(function(){
- myChart.resize()
- });
- let bgColor = '#fff';
- let title = '总量';
- let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
- let echartData = data;
- let total = 0;
- for(let i = 0;i < echartData.length;i++){
- total += echartData[i].num
- }
- option = {
- backgroundColor: bgColor,
- color: color,
- title: [{
- text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
- top: 'center',
- left: 'center',
- textStyle: {
- rich: {
- val: {
- fontSize: 24,
- color: '#333',
- fontWeight: 'bold',
- padding: [10, 0]
- },
- name: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#777',
- }
- }
- }
- }],
- tooltip: {
- trigger: 'item',
- // formatter: '{b} : {c} ({d}%)',
- formatter:function(item){
- const {name, num, percentStr} = item.data
- return `${name} : ${num} (${percentStr})`
- }
- },
- series: [{
- name: '',
- type: 'pie',
- radius: ['70%', '90%'],
- data: echartData,
- hoverAnimation:true,
- hoverOffset:5,
- itemStyle: {
- normal: {
- borderColor: bgColor,
- borderWidth: 2
- }
- },
- labelLine: {
- normal: {
- length: 20,
- length2: 120,
- lineStyle: {
- color: '#e6e6e6'
- }
- }
- },
- label: {
- normal: {
- show:false,
- formatter: params => {
- return params.name == 'A类'?params.name:''
- },
- padding: [0 , -100, 25, -100],
- rich: {
- icon: {
- fontSize: 16
- },
- name: {
- fontSize: 14,
- padding: [0, 10, 0, 4],
- color: '#666666'
- },
- value: {
- fontSize: 18,
- fontWeight: 'bold',
- color: '#333333'
- }
- }
- }
- },
- }]
- };
- myChart.setOption(option);
- }
- function emptyCircleB(data){
- var myChart = echarts.init(document.getElementById('emptyCircleB'));
- $(window).resize(function(){
- myChart.resize()
- });
- let bgColor = '#fff';
- let title = '总量';
- let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
- let echartData = data;
- let total = 0;
- for(let i = 0;i < echartData.length;i++){
- total += echartData[i].num
- }
- option = {
- backgroundColor: bgColor,
- color: color,
- title: [{
- text: data.length>0?'{val|' + total + '}\n{name|' + title + '}':'',
- top: 'center',
- left: 'center',
- textStyle: {
- rich: {
- val: {
- fontSize: 24,
- color: '#333',
- fontWeight: 'bold',
- padding: [10, 0]
- },
- name: {
- fontSize: 12,
- fontWeight: 'normal',
- color: '#777',
- }
- }
- }
- }],
- tooltip: {
- trigger: 'item',
- position: 'right',
- // formatter: '{b} : {c} ({d}%)',
- formatter:function(item){
- const {name, num, percentStr} = item.data
- return `${name} : ${num} (${percentStr})`
- }
- },
- series: [{
- name: '',
- type: 'pie',
- radius: ['70%', '90%'],
- data: echartData,
- hoverAnimation:true,
- hoverOffset:5,
- itemStyle: {
- normal: {
- borderColor: bgColor,
- borderWidth: 2
- }
- },
- labelLine: {
- normal: {
- length: 20,
- length2: 120,
- lineStyle: {
- color: '#e6e6e6'
- }
- }
- },
- label: {
- normal: {
- show:false,
- formatter: params => {
- return params.name == 'A类'?params.name:''
- },
- padding: [0 , -100, 25, -100],
- rich: {
- icon: {
- fontSize: 16
- },
- name: {
- fontSize: 14,
- padding: [0, 10, 0, 4],
- color: '#666666'
- },
- value: {
- fontSize: 18,
- fontWeight: 'bold',
- color: '#333333'
- }
- }
- }
- },
- }]
- };
- myChart.setOption(option);
- }
- //缺陷列表渲染
- function queList(data){
- let strAll = '',tmp = `mm
- <tr class="thead">
- <td class="td01">排名</td>
- <td class="td02">缺陷详情</td>
- <td class="td03">数量</td>
- <td class="td04">占比</td>
- </tr>`
- for(let i = 0;i < data.length;i++){
- strAll += `
- <tr>
- <td style="text-align:center;"><i style="background:${i < 3?'#bea571':'#eff3fc'};color:${i < 3?'#fff':'#999'};">${i+1}</i></td>
- <td><p class="td02name">${data[i].name}</p></td>
- <td>${data[i].num}</td>
- <td>${data[i].percentStr}</td>
- </tr>
- `
- }
- $(".qtable").html(tmp+strAll)
- }
- //饼图列表注释渲染
- function panDetail(data){
- let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
- let strAll = '';
- for(let i = 0;i < data.length;i++){
- strAll += `
- <tr class="explainLi">
- <td class="deptName" title="${data[i].name}">
- <p class="smp"><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
- </td>
- <td class="deptNum">${data[i].num}</td>
- <td class="percent">(${data[i].percentStr})</td>
- </tr>
- `
- }
- $(".explainPanT table").html(strAll);
- $(".explainPan").css({
- marginTop:-($(".explainPan").height()/2-20)+'px'
- })
- }
- function panDetailB(data){
- let color = ['#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336','#F2637B','#975FE4', '#399FFF', '#37CBCB', '#4CCB73','#FAD336'];
- let strAll = '';
- for(let i = 0;i < data.length;i++){
- strAll += `
- <tr class="explainLi">
- <td class="deptName" title="${data[i].name}">
- <p><i class="tip" style="background-color:${color[i]}"></i>${data[i].name}</p>
- </td>
- <td class="deptNum">${data[i].num}</td>
- <td class="percent">(${data[i].percentStr})</td>
- </tr>
- `
- }
- $(".explainPanB table").html(strAll);
- $(".explainPan").css({
- marginTop:-($(".explainPan").height()/2-20)+'px'
- })
- }
- //时间获取
- function getTimeDetail(){
- const d = new Date();
- const days = ["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
- let sec = d.getSeconds()
- let min = d.getMinutes()
- let hour = d.getHours()
- 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}`
- $(".dateDetail").html(str)
- }
|