echart-service.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="echart-content">
  3. <view class="echart-title">
  4. <view class="e-icon e5"><text class="iconfont icon-fangwenjilu"></text></view> <view class="e-name">访问记录</view>
  5. </view>
  6. <view class="echart-search">
  7. <view class="echart-search-date">
  8. <view class="echart-search-date-input">
  9. <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange">
  10. <text class="input-text">{{ queryData.startAddTime }}</text>
  11. </picker>
  12. <text class="iconfont icon-riqi"></text>
  13. </view>
  14. <view class="line">-</view>
  15. <view class="echart-search-date-input">
  16. <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindEndDateChange">
  17. <text class="input-text">{{ queryData.endAddTime }}</text>
  18. </picker>
  19. <text class="iconfont icon-riqi"></text>
  20. </view>
  21. </view>
  22. <view class="echart-search-time">
  23. <view
  24. class="time-tab"
  25. v-for="(time, index) in timeList"
  26. :class="{ current: current === index }"
  27. :key="index"
  28. @click="handleTimeClick(time.current,index)"
  29. >{{ time.label }}</view
  30. >
  31. </view>
  32. </view>
  33. <view class="echart-mains">
  34. <qiun-data-charts type="column" :opts="opts" :chartData="chartData" :animation="false"/>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import { mapState, mapMutations } from 'vuex'
  40. import chartMixin from './mixins/chart.mixin.js'
  41. export default {
  42. mixins: [chartMixin],
  43. data() {
  44. return {
  45. chartData: {},
  46. opts: {
  47. legend:{
  48. show:false
  49. },
  50. color: ["#74b9ff"],
  51. dataLabel:true,
  52. padding: [15, 30, 0, 5],
  53. enableScroll: false,
  54. xAxis: {
  55. disableGrid: true,
  56. min: 0,
  57. axisLine: false,
  58. max: 40 ,
  59. rotateLabel:true,
  60. format:'xAxisDemo3'
  61. },
  62. yAxis: {
  63. fontSize:12,
  64. fontColor:'#CCCCCC',
  65. axisLineColor:'#DCDCDC',
  66. gridColor:'#DCDCDC',
  67. boundaryGap: 'justify',
  68. disabled:true,
  69. axisLine: false,
  70. min: 0,
  71. max: 40 ,
  72. },
  73. extra: {
  74. column: {
  75. type: "group",
  76. width: 20,
  77. meterBorde: 1,
  78. meterFillColor: "#FFFFFF",
  79. activeBgColor: "#000000",
  80. activeBgOpacity: 0.08,
  81. seriesGap: 2,
  82. categoryGap: 3,
  83. barBorderCircle: false,
  84. linearType: "custom",
  85. linearOpacity: 1,
  86. customColor: ['#0984e3', '#74b9ff'],
  87. colorStop: 0
  88. }
  89. }
  90. }
  91. }
  92. },
  93. created() {
  94. this.getServerData()
  95. },
  96. computed: {},
  97. methods: {
  98. getServerData() {
  99. setTimeout(() => {
  100. //模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
  101. let res = {
  102. categories: [
  103. '美博会',
  104. '玻尿酸',
  105. '氨基酸',
  106. 'Rossa阿萨科技的和',
  107. '啊啊咔咔卡时间段',
  108. '啊啊咔咔卡时间段',
  109. '啊啊咔咔卡时间段',
  110. '啊啊咔咔卡时间段',
  111. '啊啊咔咔卡时间段',
  112. '奥术大师..'
  113. ],
  114. series: [
  115. {
  116. name: '',
  117. data: [50, 72, 100, 83, 63, 42, 42, 42, 42, 42]
  118. }
  119. ]
  120. }
  121. this.chartData = JSON.parse(JSON.stringify(res))
  122. }, 500)
  123. }
  124. },
  125. onShow() {}
  126. }
  127. </script>
  128. <style lang="scss">
  129. </style>