SApercent.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520
  1. <template>
  2. <div class="percent_box">
  3. <div class="title_box"><p>PR(百分等级)</p></div>
  4. <!--正确率-->
  5. <div class="percent_list">
  6. <div class="piedata_box" v-for="(item,index) in accuracydatas">
  7. <div class="pie_box">
  8. <div :id="item.idname" :style="{width: '100%', height: '200px'}"></div>
  9. </div>
  10. <div class="pie_title">
  11. <p class="title_name">高分组答对率</p>
  12. <p class="title_num">{{item.high_accuracy}}%</p>
  13. <p class="title_name title_two">低分组答对率</p>
  14. <p class="title_num">{{item.low_accuracy}}%</p>
  15. </div>
  16. </div>
  17. </div>
  18. <!--RP百分比-->
  19. <div class="percent_list">
  20. <div class="piedata_box" v-for="(items,index) in prdata">
  21. <div class="pie_box">
  22. <div :id="items.idname" :style="{width: '100%', height: '200px'}"></div>
  23. </div>
  24. <div class="pie_marked">
  25. <Icon :type="items.icon_type" :class="items.icon_color" size="48"/>
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. accuracydatas: [],
  36. prdata:[],
  37. }
  38. },
  39. created() {
  40. this.init();
  41. },
  42. mounted() {
  43. this.init();
  44. },
  45. computed: {
  46. accuracyPRdata() {
  47. return this.$store.state.accuracyPR
  48. },
  49. },
  50. methods: {
  51. //本班准确率
  52. //答对率
  53. accuracy_one(obj) {
  54. //this.$store.state.pie.mode = false;
  55. let myChart = this.$echarts.init(document.getElementById('pie_one'));
  56. myChart.setOption({
  57. title: {
  58. text: obj.titlenum + '%',
  59. subtext: obj.echartstitle,
  60. x: 'center',
  61. y: '35%',
  62. textStyle: {
  63. fontWeight: 'normal',
  64. color: '#0580f2',
  65. fontSize: '22'
  66. },
  67. subtextStyle: {
  68. fontSize: 11,
  69. fontWeight: 'bolder',
  70. color: '#333'
  71. },
  72. },
  73. color: ['rgba(176, 212, 251, 1)'],
  74. legend: {
  75. show: false,
  76. itemGap: 12,
  77. data: ['01', '02']
  78. },
  79. series: [{
  80. name: obj.data_name,
  81. type: 'pie',
  82. clockWise: true,
  83. radius: ['70%', '100%'],
  84. itemStyle: {
  85. normal: {
  86. label: {
  87. show: false
  88. },
  89. labelLine: {
  90. show: false
  91. }
  92. }
  93. },
  94. hoverAnimation: false,
  95. data: [{
  96. value: obj.occupy,
  97. name: '01',
  98. itemStyle: {
  99. normal: {
  100. color: { // 完成的圆环的颜色
  101. colorStops: [{
  102. offset: 0,
  103. color: '#00cefc' // 0% 处的颜色
  104. }, {
  105. offset: 1,
  106. color: '#367bec' // 100% 处的颜色
  107. }]
  108. },
  109. label: {
  110. show: false
  111. },
  112. labelLine: {
  113. show: false
  114. }
  115. }
  116. }
  117. }, {
  118. name: '02',
  119. value: obj.residue
  120. }]
  121. }]
  122. })
  123. },
  124. accuracy_two(obj) {
  125. //this.$store.state.pie.mode = false;
  126. let myChart = this.$echarts.init(document.getElementById('pie_two'));
  127. myChart.setOption({
  128. title: {
  129. text: obj.titlenum +'%',
  130. subtext: obj.echartstitle,
  131. x: 'center',
  132. y: '35%',
  133. textStyle: {
  134. fontWeight: 'normal',
  135. color: '#0580f2',
  136. fontSize: '22'
  137. },
  138. subtextStyle: {
  139. fontSize: 11,
  140. fontWeight: 'bolder',
  141. color: '#333'
  142. },
  143. },
  144. color: ['rgba(176, 212, 251, 1)'],
  145. legend: {
  146. show: false,
  147. itemGap: 12,
  148. data: ['01', '02']
  149. },
  150. series: [{
  151. name: obj.data_name,
  152. type: 'pie',
  153. clockWise: true,
  154. radius: ['70%', '100%'],
  155. itemStyle: {
  156. normal: {
  157. label: {
  158. show: false
  159. },
  160. labelLine: {
  161. show: false
  162. }
  163. }
  164. },
  165. hoverAnimation: false,
  166. data: [{
  167. value: obj.occupy,
  168. name: '01',
  169. itemStyle: {
  170. normal: {
  171. color: { // 完成的圆环的颜色
  172. colorStops: [{
  173. offset: 0,
  174. color: '#00cefc' // 0% 处的颜色
  175. }, {
  176. offset: 1,
  177. color: '#367bec' // 100% 处的颜色
  178. }]
  179. },
  180. label: {
  181. show: false
  182. },
  183. labelLine: {
  184. show: false
  185. }
  186. }
  187. }
  188. }, {
  189. name: '02',
  190. value: obj.residue
  191. }]
  192. }]
  193. })
  194. },
  195. accuracy_three(obj) {
  196. //this.$store.state.pie.mode = false;
  197. let myChart = this.$echarts.init(document.getElementById('pie_three'));
  198. myChart.setOption({
  199. title: {
  200. text: obj.titlenum + '%',
  201. subtext: obj.echartstitle,
  202. x: 'center',
  203. y: '35%',
  204. textStyle: {
  205. fontWeight: 'normal',
  206. color: '#0580f2',
  207. fontSize: '22'
  208. },
  209. subtextStyle: {
  210. fontSize: 11,
  211. fontWeight: 'bolder',
  212. color: '#333'
  213. },
  214. },
  215. color: ['rgba(176, 212, 251, 1)'],
  216. legend: {
  217. show: false,
  218. itemGap: 12,
  219. data: ['01', '02']
  220. },
  221. series: [{
  222. name: obj.data_name,
  223. type: 'pie',
  224. clockWise: true,
  225. radius: ['70%', '100%'],
  226. itemStyle: {
  227. normal: {
  228. label: {
  229. show: false
  230. },
  231. labelLine: {
  232. show: false
  233. }
  234. }
  235. },
  236. hoverAnimation: false,
  237. data: [{
  238. value: obj.occupy,
  239. name: '01',
  240. itemStyle: {
  241. normal: {
  242. color: { // 完成的圆环的颜色
  243. colorStops: [{
  244. offset: 0,
  245. color: '#00cefc' // 0% 处的颜色
  246. }, {
  247. offset: 1,
  248. color: '#367bec' // 100% 处的颜色
  249. }]
  250. },
  251. label: {
  252. show: false
  253. },
  254. labelLine: {
  255. show: false
  256. }
  257. }
  258. }
  259. }, {
  260. name: '02',
  261. value: obj.residue
  262. }]
  263. }]
  264. })
  265. },
  266. //PR值
  267. pr_one(obj) {
  268. //this.$store.state.pie.mode = false;
  269. let myChart = this.$echarts.init(document.getElementById('pr_one'));
  270. myChart.setOption({
  271. title: {
  272. text: obj.titlenum ,
  273. subtext: obj.echartstitle,
  274. x: 'center',
  275. y: '35%',
  276. textStyle: {
  277. fontWeight: 'normal',
  278. color: '#0580f2',
  279. fontSize: '22'
  280. },
  281. subtextStyle: {
  282. fontSize: 11,
  283. fontWeight: 'bolder',
  284. color: '#333'
  285. },
  286. },
  287. color: ['rgba(176, 212, 251, 1)'],
  288. legend: {
  289. show: false,
  290. itemGap: 12,
  291. data: ['01', '02']
  292. },
  293. series: [{
  294. name: obj.data_name,
  295. type: 'pie',
  296. clockWise: true,
  297. radius: ['70%', '100%'],
  298. itemStyle: {
  299. normal: {
  300. label: {
  301. show: false
  302. },
  303. labelLine: {
  304. show: false
  305. }
  306. }
  307. },
  308. hoverAnimation: false,
  309. data: [{
  310. value: obj.occupy,
  311. name: '01',
  312. itemStyle: {
  313. normal: {
  314. color: { // 完成的圆环的颜色
  315. colorStops: [{
  316. offset: 0,
  317. color: '#66CCCC' // 0% 处的颜色
  318. }, {
  319. offset: 1,
  320. color: '#00FFFF' // 100% 处的颜色
  321. }]
  322. },
  323. label: {
  324. show: false
  325. },
  326. labelLine: {
  327. show: false
  328. }
  329. }
  330. }
  331. }, {
  332. name: '02',
  333. value: obj.residue
  334. }]
  335. }]
  336. })
  337. },
  338. pr_two(obj) {
  339. //this.$store.state.pie.mode = false;
  340. let myChart = this.$echarts.init(document.getElementById('pr_two'));
  341. myChart.setOption({
  342. title: {
  343. text: obj.titlenum ,
  344. subtext: obj.echartstitle,
  345. x: 'center',
  346. y: '35%',
  347. textStyle: {
  348. fontWeight: 'normal',
  349. color: '#0580f2',
  350. fontSize: '22'
  351. },
  352. subtextStyle: {
  353. fontSize: 11,
  354. fontWeight: 'bolder',
  355. color: '#333'
  356. },
  357. },
  358. color: ['rgba(176, 212, 251, 1)'],
  359. legend: {
  360. show: false,
  361. itemGap: 12,
  362. data: ['01', '02']
  363. },
  364. series: [{
  365. name: obj.data_name,
  366. type: 'pie',
  367. clockWise: true,
  368. radius: ['70%', '100%'],
  369. itemStyle: {
  370. normal: {
  371. label: {
  372. show: false
  373. },
  374. labelLine: {
  375. show: false
  376. }
  377. }
  378. },
  379. hoverAnimation: false,
  380. data: [{
  381. value: obj.occupy,
  382. name: '01',
  383. itemStyle: {
  384. normal: {
  385. color: { // 完成的圆环的颜色
  386. colorStops: [{
  387. offset: 0,
  388. color: '#66CCCC' // 0% 处的颜色
  389. }, {
  390. offset: 1,
  391. color: '#00FFFF' // 100% 处的颜色
  392. }]
  393. },
  394. label: {
  395. show: false
  396. },
  397. labelLine: {
  398. show: false
  399. }
  400. }
  401. }
  402. }, {
  403. name: '02',
  404. value: obj.residue
  405. }]
  406. }]
  407. })
  408. },
  409. pr_three(obj) {
  410. //this.$store.state.pie.mode = false;
  411. let myChart = this.$echarts.init(document.getElementById('pr_three'));
  412. myChart.setOption({
  413. title: {
  414. text: obj.titlenum,
  415. subtext: obj.echartstitle,
  416. x: 'center',
  417. y: '35%',
  418. textStyle: {
  419. fontWeight: 'normal',
  420. color: '#0580f2',
  421. fontSize: '22'
  422. },
  423. subtextStyle: {
  424. fontSize: 11,
  425. fontWeight: 'bolder',
  426. color: '#333'
  427. },
  428. },
  429. color: ['rgba(176, 212, 251, 1)'],
  430. legend: {
  431. show: false,
  432. itemGap: 12,
  433. data: ['01', '02']
  434. },
  435. series: [{
  436. name: obj.data_name,
  437. type: 'pie',
  438. clockWise: true,
  439. radius: ['70%', '100%'],
  440. itemStyle: {
  441. normal: {
  442. label: {
  443. show: false
  444. },
  445. labelLine: {
  446. show: false
  447. }
  448. }
  449. },
  450. hoverAnimation: false,
  451. data: [{
  452. value: obj.occupy,
  453. name: '01',
  454. itemStyle: {
  455. normal: {
  456. color: { // 完成的圆环的颜色
  457. colorStops: [{
  458. offset: 0,
  459. color: '#66CCCC' // 0% 处的颜色
  460. }, {
  461. offset: 1,
  462. color: '#00FFFF' // 100% 处的颜色
  463. }]
  464. },
  465. label: {
  466. show: false
  467. },
  468. labelLine: {
  469. show: false
  470. }
  471. }
  472. }
  473. }, {
  474. name: '02',
  475. value: obj.residue
  476. }]
  477. }]
  478. })
  479. },
  480. init() {
  481. let _this = this;
  482. this.$api.FindTeachPR({})
  483. .then((response) => {
  484. //console.log(response.result.data,88899999)
  485. _this.$store.state.accuracyPR = response.result.data;
  486. })
  487. }
  488. },
  489. watch: {
  490. // 监听指令
  491. accuracyPRdata(value) {
  492. if (value) {
  493. console.log(value, 6666);
  494. this.accuracydatas = value.accuracydata;
  495. this.prdata = value.percentdata;
  496. let pie_one = value.accuracydata[0];
  497. let pie_two = value.accuracydata[1];
  498. let pie_three = value.accuracydata[2];
  499. let pr_one = value.percentdata[0];
  500. let pr_two = value.percentdata[1];
  501. let pr_three = value.percentdata[2];
  502. this.accuracy_one(pie_one);
  503. this.accuracy_two(pie_two);
  504. this.accuracy_three(pie_three);
  505. this.pr_one(pr_one);
  506. this.pr_two(pr_two);
  507. this.pr_three(pr_three);
  508. }
  509. },
  510. }
  511. }
  512. </script>