s1jianCe.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div @click="toDetailed()" class="statisticsPage" :style="{width:width}">
  3. <div :id="id" :style="{height:height}"/>
  4. <!-- 打开详情弹窗-->
  5. <div v-if="dialogOff">
  6. <dialogView
  7. :dialogOff = "dialogOff"
  8. @close = "close"
  9. :title="title"
  10. :data="data"
  11. :mubiao="mubiao"
  12. />
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import echarts from 'echarts'
  18. import dialogView from '../properties/s1jianCePro.vue'
  19. import {GetPercent,GetMax} from '../js/config.js'
  20. export default {
  21. components:{
  22. dialogView
  23. },
  24. props: {
  25. data: {
  26. type: Object,
  27. },
  28. width:{
  29. type:String,
  30. default:"25%"
  31. },
  32. height:{
  33. type:String,
  34. default: window.screen.height/5+"px"
  35. },
  36. id:{
  37. type:String,
  38. default:"s1jianCe"
  39. },
  40. click:{
  41. type:String,
  42. default:'true'
  43. },
  44. colorw:{
  45. type:String,
  46. default:'true'
  47. },
  48. mubiao:{
  49. type:String,
  50. default:''
  51. }
  52. },
  53. data () {
  54. return {
  55. title:'检测报告差错率',
  56. dialogOff:false,
  57. }
  58. },
  59. mounted(){
  60. this.drawLine();
  61. },
  62. methods: {
  63. close(){
  64. this.dialogOff = false
  65. },
  66. /* 跳转统计页面*/
  67. toDetailed(){
  68. if(this.click == "true"){
  69. this.dialogOff = true
  70. }
  71. },
  72. drawLine(){
  73. var echarts = require('echarts');
  74. let s1jianCe = echarts.init(document.getElementById(this.id))
  75. // let data = [];
  76. // data.push(Number(this.data.t_gdyrqcwt5Begin.number<0?0-this.data.t_gdyrqcwt5Begin.number:this.data.t_gdyrqcwt5Begin.number)*100)
  77. // data.push(Number(this.data.t_gdyrqcwt5End.number<0?0-this.data.t_gdyrqcwt5End.number:this.data.t_gdyrqcwt5End.number)*100)
  78. // data.push(Number(this.data.t_gdyrqcwt6Begin.number<0?0-this.data.t_gdyrqcwt6Begin.number:this.data.t_gdyrqcwt6Begin.number)*100)
  79. // data.push(Number(this.data.t_gdyrqcwt6End.number<0?0-this.data.t_gdyrqcwt6End.number:this.data.t_gdyrqcwt6End.number)*100)
  80. // let dataAxis = [];
  81. // dataAxis.push("准确率");
  82. // dataAxis.push("准确率");
  83. // dataAxis.push("完成率");
  84. // // dataAxis.push("完成率");
  85. // let beingDate=this.data.t_gdyrqcwt5Begin.date
  86. // let endDate=this.data.t_gdyrqcwt5End.date
  87. // let e=[this.data.t_mjjcbgNum.number[0],this.data.t_mjjcbgNum.numberAll[0],this.data.t_mjjcbgNum.res[0]]
  88. let e = 100 -this.data.t_mjjcbgNum.res[0]
  89. let option = {
  90. //v3
  91. title: {
  92. text: this.title,
  93. // subtext: 'Fake Data',
  94. left: 'left',
  95. textStyle:{ fontSize:14,color: this.colorw }
  96. },
  97. tooltip: {
  98. trigger: 'item'
  99. },
  100. color:['#ffcc00','#33FFFF'],
  101. series: [
  102. {
  103. type: 'pie',
  104. radius: '50%',
  105. label: {
  106. formatter: '{b}: {d}%'
  107. },
  108. data: [
  109. { value: this.data.t_mjjcbgNum.res[0], name: '差错率' },
  110. { value: e, name: '正确率' }
  111. ],
  112. emphasis: {
  113. itemStyle: {
  114. shadowBlur: 10,
  115. shadowOffsetX: 0,
  116. shadowColor: 'rgba(0, 0, 0, 0.5)'
  117. }
  118. }
  119. }
  120. ]
  121. };
  122. option && s1jianCe.setOption(option);
  123. }
  124. }
  125. }
  126. </script>
  127. <style scoped>
  128. #s1jianCe:hover{
  129. transition: all 0.5s;
  130. transform:scale(1.03);
  131. }
  132. .statisticsPage{
  133. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  134. float: left;
  135. }
  136. </style>