人民医院前端

IVRSatisfactionByNow.vue 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. <template>
  2. <div id="box" style="width: 385px;">
  3. <div style="margin-left: 200px;position: relative;bottom: 3px;">
  4. <el-button size="mini" @click="changeType3">修</el-button>
  5. <el-button size="mini" @click="changeType2">调</el-button>
  6. <el-button size="mini" @click="changeType4">车</el-button>
  7. </div>
  8. <div id="IVRSatisfactionByNow" style="width: 100%;height: 380px;padding: 10px 10px 0 15px;box-sizing: border-box;">
  9. <el-col :span="6" class="bgbox" v-for="item in dataname">
  10. <marquee-text :duration="15" :repeat="3" style="padding: 0 5px 20px 0;text-align: center;margin-bottom: 30px;">{{ item.F_name }}</marquee-text>
  11. <!-- <div class="bgboxname" v-if="item.F_name.length<=5">{{ item.F_name }}</div>
  12. <div class="bgboxname" v-if="item.F_name.length>5">{{ item.F_name.slice(0,4) }}...</div> -->
  13. <!-- <div class="bgboxname"><div>{{ item.F_name }}</div></div> -->
  14. <div class="bgboxcon">{{ item.keycount }}</div>
  15. </el-col>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import MarqueeText from 'vue-marquee-text-component'
  21. import {
  22. GetTopGD
  23. } from "../api/dataAnalysis/monitorData.js";
  24. export default {
  25. name: "Home",
  26. props: {
  27. searchData: {
  28. type: String,
  29. default: ''
  30. }
  31. },
  32. components: {
  33. MarqueeText
  34. },
  35. data() {
  36. return {
  37. seadata: '1',
  38. gddata:'3000',
  39. state: 0,
  40. count: [],
  41. // countname: ['基础和后勤保障部','信息科','设备科'],
  42. countname: [],
  43. countn: [],
  44. dataname:[]
  45. };
  46. },
  47. watch: {
  48. searchData(val, oval) {
  49. this.seadata = val
  50. this.getDate()
  51. },
  52. // "state": function() {
  53. // this.GetIVRSatisfactionByNow()
  54. // }
  55. },
  56. created() {
  57. this.getDate()
  58. setInterval(()=>{
  59. this.getDate()
  60. },360000)
  61. },
  62. mounted() {},
  63. methods: {
  64. changeType3(){
  65. this.gddata = '3000'
  66. this.getDate()
  67. },
  68. changeType2(){
  69. this.gddata = '2000'
  70. this.getDate()
  71. },
  72. changeType4(){
  73. this.gddata = '4000'
  74. this.getDate()
  75. },
  76. getDate() {
  77. const params = {
  78. type: this.seadata,
  79. gdtype: this.gddata
  80. }
  81. GetTopGD(params).then((res) => {
  82. if (res.state.toLowerCase() == 'success') {
  83. this.dataname = []
  84. let dataAll = res.data
  85. if(dataAll.length>16){
  86. dataAll.forEach((v,n)=>{
  87. if(n<16){
  88. this.dataname.push(v)
  89. }
  90. })
  91. }else{
  92. dataAll.forEach((v,n)=>{
  93. this.dataname.push(v)
  94. })
  95. }
  96. // // let arr = [data.data[0].basatisfied,data.data[0].nosatisfied,data.data[0].satisfied]
  97. // let arr = [100, 110, 200]
  98. // this.count = arr.sort(this.ortChange).reverse()
  99. // this.count.forEach((v, n) => {
  100. // if (n == 0) {
  101. // Object.keys(data.data[0]).forEach((key, n) => {
  102. // if (v == data.data[0][key]) {
  103. // this.countname.push(this.getInf(key))
  104. // delete data.data[0][key]
  105. // }
  106. // })
  107. // } else if (n == 1) {
  108. // Object.keys(data.data[0]).forEach((key, n) => {
  109. // if (v == data.data[0][key]) {
  110. // this.countname.push(this.getInf(key))
  111. // delete data.data[0][key]
  112. // }
  113. // })
  114. // } else {
  115. // Object.keys(data.data[0]).forEach((key, n) => {
  116. // if (v == data.data[0][key]) {
  117. // this.countname.push(this.getInf(key))
  118. // }
  119. // })
  120. // }
  121. // })
  122. // console.log(this.count)
  123. // console.log(this.countname)
  124. // this.state = 1
  125. }
  126. });
  127. },
  128. ortChange(a, b) {
  129. return a - b;
  130. },
  131. getInf(type) {
  132. const state = {
  133. "satisfied": '满意',
  134. "basatisfied": '基本满意',
  135. "nosatisfied": '不满意'
  136. }
  137. return state[type]
  138. },
  139. GetIVRSatisfactionByNow() {
  140. let myChart = this.$echarts.init(document.getElementById("IVRSatisfactionByNow"));
  141. var Color = ['#503e8d', '#5d3ec5',
  142. '#874f5f', '#b6575c', '#623363', '#962e66', '#ff4e00', '#fff400', '#0089fe', '#00fdc7',
  143. '#8f47ff', '#2672cc',
  144. ]
  145. let option = {
  146. grid: {
  147. top: 1,
  148. // bottom: 20,
  149. left: 70,
  150. right: 40,
  151. height: '100%',
  152. },
  153. xAxis: {
  154. show: false,
  155. type: 'value'
  156. },
  157. yAxis: [{
  158. type: 'category',
  159. inverse: true,
  160. axisLabel: {
  161. show: true,
  162. textStyle: {
  163. fontSize: '14',
  164. color: '#fff'
  165. },
  166. },
  167. splitLine: {
  168. show: false
  169. },
  170. axisTick: {
  171. show: false
  172. },
  173. axisLine: {
  174. show: false
  175. },
  176. data: this.countname
  177. }, {
  178. type: 'category',
  179. inverse: true,
  180. axisTick: 'none',
  181. axisLine: 'none',
  182. show: true,
  183. axisLabel: {
  184. textStyle: {
  185. color: '#ffffff',
  186. fontSize: '14'
  187. },
  188. formatter: function(value) {
  189. if (value >= 10000) {
  190. return (value / 10000).toLocaleString() + '万';
  191. } else {
  192. return value.toLocaleString();
  193. }
  194. },
  195. },
  196. data: this.count
  197. }],
  198. series: [{
  199. type: 'bar',
  200. zlevel: 1,
  201. showBackground: true,
  202. backgroundStyle: {
  203. borderRadius: [0, 20, 20, 0],
  204. color: '#1a3b55'
  205. },
  206. itemStyle: {
  207. normal: {
  208. barBorderRadius: [0, 20, 20, 0],
  209. color: function(params) {
  210. var colorList = [];
  211. for (var i = 6; i > 0; i--) {
  212. colorList.push({
  213. type: 'bar',
  214. colorStops: [{
  215. offset: 0,
  216. color: Color[i * 2 - 2] // 0% 处的颜色
  217. }, {
  218. offset: 1,
  219. color: Color[i * 2 - 1] // 100% 处的颜色
  220. }],
  221. globalCoord: false, // 缺省为 false
  222. });
  223. }
  224. return colorList[params.dataIndex]
  225. },
  226. },
  227. },
  228. barWidth: 25,
  229. data: this.count
  230. }]
  231. };
  232. myChart.setOption(option);
  233. }
  234. }
  235. };
  236. </script>
  237. <style scoped>
  238. /deep/.el-button {
  239. border: 1px solid #46bec3;
  240. background: #011832;
  241. color: #fff;
  242. }
  243. #box {
  244. background-image: url("../assets/imgs/报修高频事件.png");
  245. background-size: 100% 100%;
  246. background-repeat: no-repeat;
  247. padding-top: 10px;
  248. }
  249. .bgbox {
  250. width: 90px;
  251. height: 75px;
  252. text-align: center;
  253. background-image: url("../assets/imgs/编组 5.png");
  254. margin-top: 10px;
  255. position: relative;
  256. background-size: 100% 90%;
  257. }
  258. /* 移动 */
  259. @keyframes scrolltext{
  260. 0% {
  261. transform: translateX(100%);
  262. -webkit-transform: translateX(100%);
  263. }
  264. 100% {
  265. transform: translateX(-100%);
  266. -webkit-transform: translateX(-100%);
  267. }
  268. }
  269. @-webkit-keyframes scrolltext {
  270. 0% {
  271. transform: translateX(100%);
  272. -webkit-transform: translateX(100%);
  273. }
  274. 100% {
  275. transform: translateX(-100%);
  276. -webkit-transform: translateX(-100%);
  277. }
  278. }
  279. .bgboxname{
  280. height:21px;
  281. overflow: hidden;
  282. }
  283. .bgboxname > div{
  284. white-space: nowrap;
  285. width: 100%;
  286. animation: 5s scrolltext infinite normal;
  287. }
  288. .bgboxcon {
  289. width: 90px;
  290. text-align: center;
  291. position: absolute;
  292. right: 5px;
  293. bottom: 30px;
  294. color: #38acac;
  295. font-size: 14px;
  296. }
  297. </style>