teamPerformanceMonth.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div @click="toDetailed()" class="statisticsPage" style="width:100%;height:85%">
  3. <div id="chartOR" style="width:100%;height:100%"></div>
  4. <div v-if="dialogOff">
  5. <dialogView
  6. :dialogOff = "dialogOff"
  7. @close = "close"
  8. :data="userInfo"
  9. :date="date"
  10. />
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import echarts from 'echarts'
  16. import dialogView from '../messageBox/teamMonthDetails'
  17. export default {
  18. data() {
  19. return {
  20. // title:'人员培训',
  21. dialogOff:false,
  22. userInfo:[]
  23. }
  24. },
  25. props:{
  26. data: {
  27. type: Array,
  28. },
  29. date: {
  30. type: String,
  31. },
  32. click:{
  33. type:String,
  34. default:'true'
  35. },
  36. },
  37. components:{
  38. dialogView
  39. },
  40. watch: {
  41. data(v) {
  42. this.getEchartData()
  43. }
  44. },
  45. mounted() {
  46. this.getEchartData()
  47. },
  48. methods: {
  49. close(){
  50. this.dialogOff = false
  51. },
  52. /* 跳转统计页面*/
  53. toDetailed(){
  54. if(this.click == "true"){
  55. this.dialogOff = true
  56. }
  57. },
  58. getEchartData() {
  59. if (true) {
  60. let that = this
  61. let ors= echarts.init(document.getElementById("chartOR"))
  62. let option = {
  63. legend: {
  64. textStyle:{
  65. color:'#fff'
  66. }
  67. },
  68. tooltip: {},
  69. color:['#99FFFF'],
  70. dataset: {
  71. dimensions: ['NAME_', 'jiage'],
  72. source: this.data
  73. },
  74. xAxis: {
  75. type: 'category',
  76. axisLabel:{//修改坐标系字体颜色
  77. show:true,
  78. textStyle:{
  79. color:"#fff"
  80. }
  81. },
  82. axisLine: {
  83. show: true,
  84. lineStyle: {
  85. color: "rgba(255,255,255,1)",
  86. type: "solid"
  87. }
  88. }
  89. },
  90. yAxis: {
  91. axisLabel:{//修改坐标系字体颜色
  92. show:true,
  93. textStyle:{
  94. color:"#fff"
  95. }
  96. },
  97. axisLine: {//y轴线的颜色以及宽度
  98. show: true,
  99. lineStyle: {
  100. color: "rgba(255,255,255,1)",
  101. type: "solid"
  102. },
  103. },
  104. splitLine: {
  105. show: false
  106. }
  107. },
  108. series: [{ name: '销量',type: 'bar',barWidth:'10%',label: {show: true,position: 'top'} }]
  109. };
  110. ors.on('click', function (params) {
  111. // console.log(params.data.bian_zhi_ren_)
  112. that.userInfo[0] = params.data.bian_zhi_ren_
  113. that.userInfo[1] = params.data.NAME_
  114. // console.log(params.dataIndex);
  115. })
  116. option && ors.setOption(option);
  117. }
  118. },
  119. },
  120. }
  121. </script>
  122. <style lang="scss" scoped>
  123. </style>