index.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <!--
  2. * @Author: WangQiBiao
  3. * @Date: 2019-09-25 14:10:08
  4. * @LastEditors: wjc
  5. * @LastEditTime: 2025-11-18 09:50:12
  6. * @Description: 在线沟通
  7. -->
  8. <template>
  9. <div class="communication">
  10. <TitleCom :isBorder="true">在线沟通</TitleCom>
  11. <div class="map">
  12. <div class="map-item proportion" id="proportion"></div>
  13. <div class="map-item satisfaction" id="satisfaction"></div>
  14. </div>
  15. <div class="linst-line"></div>
  16. <div class="list">
  17. <vueSeamless :data="dialogData" :class-option="optionScroll" class="list">
  18. <div class="list-item" v-for="(item, idx) in dialogData" :key="idx">
  19. <div class="list-item-lf">
  20. <TagCom type="time">{{item.createAt}}</TagCom>
  21. <span class="list-item-txt">{{item.content.replace('提交了', '')}}</span>
  22. </div>
  23. <div class="list-item-lr">
  24. <TagCom v-if="item.label === '建议'" type="advice">建议</TagCom>
  25. <TagCom v-if="item.label === '表扬'" type="praise">表扬</TagCom>
  26. <TagCom v-if="item.label === '投诉'" type="complaints">投诉</TagCom>
  27. <TagCom v-if="item.label === '咨询'" type="consulting">咨询</TagCom>
  28. <TagCom v-if="item.label === '待受理'" type="accept">待受理</TagCom>
  29. </div>
  30. </div>
  31. </vueSeamless>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import TitleCom from '@/components/title'
  37. import TagCom from '@/components/tag'
  38. import * as echarts from 'echarts'
  39. import { api } from '@/api'
  40. import vueSeamless from 'vue-seamless-scroll'
  41. export default {
  42. computed: {
  43. optionScroll () {
  44. return {
  45. step: 0.5
  46. }
  47. }
  48. },
  49. data () {
  50. return {
  51. reportAdvice: '',
  52. reportComplaint: '',
  53. reportSuggest: '',
  54. reportPraise: '',
  55. reportServiceScore: '',
  56. reportSum: {},
  57. dialogData: []
  58. }
  59. },
  60. components: {
  61. TitleCom,
  62. TagCom,
  63. vueSeamless
  64. },
  65. mounted () {
  66. this.init()
  67. setInterval(() => {
  68. this.init()
  69. }, 30000)
  70. },
  71. methods: {
  72. init () {
  73. api.getDialogRecord().then(res => {
  74. this.dialogData = res.data.data.list
  75. })
  76. this.getReportSum()
  77. },
  78. getReportSum () {
  79. api.getReportSum().then(res => {
  80. res.data.data.reportRepairStatisticsVos && res.data.data.reportRepairStatisticsVos.map(item => {
  81. this[item.type] = item.total
  82. })
  83. this.circleProportionMap()
  84. this.createSatisfactionMap()
  85. })
  86. },
  87. /**
  88. * 占比
  89. */
  90. circleProportionMap () {
  91. var myChart = echarts.init(document.getElementById('proportion'))
  92. var option = {
  93. // backgroundColor: '#2c343c',
  94. series: [
  95. {
  96. type: 'pie',
  97. radius: '46%',
  98. // radius: ['35%', '60%'],
  99. roseType: 'radius',
  100. center: ['50%', '50%'],
  101. label: {
  102. normal: {
  103. formatter: '{b|{b}}\n{c}',
  104. fontSize: 10,
  105. lineHeight: 14,
  106. rich: {
  107. b: {
  108. color: '#6786B8',
  109. fontSize: 10
  110. }
  111. }
  112. }
  113. },
  114. data: [
  115. {
  116. value: this.reportAdvice,
  117. name: '咨询',
  118. label: {
  119. show: true,
  120. color: '#2CDAE1'
  121. },
  122. itemStyle: {
  123. color: '#2CDAE1'
  124. }
  125. },
  126. {
  127. value: this.reportComplaint,
  128. name: '投诉',
  129. label: {
  130. show: true,
  131. color: '#DE5B5B'
  132. },
  133. itemStyle: {
  134. color: '#DE5B5B'
  135. }
  136. },
  137. {
  138. value: this.reportSuggest,
  139. name: '建议',
  140. label: {
  141. show: true,
  142. color: '#2592E1'
  143. },
  144. itemStyle: {
  145. color: '#2592E1'
  146. }
  147. },
  148. {
  149. value: this.reportPraise,
  150. name: '表扬',
  151. label: {
  152. show: true,
  153. color: '#1EC74D'
  154. },
  155. itemStyle: {
  156. color: '#1EC74D'
  157. }
  158. }
  159. ]
  160. }
  161. ]
  162. }
  163. myChart.setOption(option)
  164. },
  165. /**
  166. * 满意度
  167. */
  168. createSatisfactionMap () {
  169. var myChart = echarts.init(document.getElementById('satisfaction'))
  170. var option = {
  171. // this.reportServiceScore
  172. name: '仪表盘',
  173. grid: {
  174. top: '0px',
  175. bottom: '5px',
  176. left: '0px',
  177. right: '0px'
  178. },
  179. title: {
  180. show: true,
  181. text: [`{titleBg|满意度}`],
  182. left: 'center',
  183. bottom: '0',
  184. textStyle: {
  185. rich: {
  186. titleBg: {
  187. backgroundColor: '#14223C',
  188. borderRadius: 4,
  189. height: 20,
  190. width: 50,
  191. color: '#01DFFC',
  192. fontSize: 12
  193. }
  194. }
  195. }
  196. },
  197. series: [
  198. {
  199. type: 'gauge',
  200. radius: '100%',
  201. axisLine: {
  202. show: true,
  203. lineStyle: {
  204. width: 12,
  205. color: [
  206. [
  207. ((this.reportServiceScore) / 100).toFixed(1), new echarts.graphic.LinearGradient(0, 0, 1, 0, [
  208. {
  209. offset: 0,
  210. color: '#43D3C7'
  211. },
  212. {
  213. offset: 1,
  214. color: '#2D32F0'
  215. }
  216. ])
  217. ],
  218. [
  219. 1, '#182743'
  220. ]
  221. ]
  222. }
  223. },
  224. splitLine: {
  225. show: false
  226. },
  227. axisTick: {
  228. show: false
  229. },
  230. axisLabel: {
  231. show: false
  232. },
  233. pointer: {
  234. show: false
  235. },
  236. title: {
  237. offsetCenter: [0, '20%'],
  238. fontSize: 12,
  239. fontFamily: 'Microsoft YaHei',
  240. fontWeight: '400',
  241. color: '#5774A2'
  242. },
  243. detail: {
  244. formatter: `${this.reportServiceScore}%`,
  245. offsetCenter: [0, 0],
  246. fontSize: 20,
  247. fontFamily: 'DS-Digital',
  248. fontWeight: 'bold',
  249. color: '#00D2ED'
  250. },
  251. data: [{ value: 0, name: '' }]
  252. }
  253. ]
  254. }
  255. myChart.setOption(option)
  256. }
  257. }
  258. }
  259. </script>
  260. <style lang="scss" scoped>
  261. @import './index.scss';
  262. </style>