SAsubjectsmanifestation.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. <template>
  2. <div class="subjects_box">
  3. <div class="subjects_title"><p>科目表现对比</p></div>
  4. <li class="subjects_listbox">
  5. <div class="top">
  6. <p class="num">{{list_data[0].score}}</p>
  7. <p class="datatitle">{{list_data[0].title}}</p>
  8. </div>
  9. <div class="center">
  10. <div id="myChart_one" :style="{width: '100%', height: '150px'}"></div>
  11. </div>
  12. <div class="bottom">
  13. <p class="num">{{list_data[0].belowscore}}<Icon :type="list_data[0].icon_type" :class="list_data[0].icon_color" /></p>
  14. <p class="datatitle">{{list_data[0].below_title}}</p>
  15. </div>
  16. </li>
  17. <li class="subjects_listbox">
  18. <div class="top">
  19. <p class="num">{{list_data[1].score}}</p>
  20. <p class="datatitle">{{list_data[1].title}}</p>
  21. </div>
  22. <div class="center">
  23. <div id="myChart_two" :style="{width: '100%', height: '150px'}"></div>
  24. </div>
  25. <div class="bottom">
  26. <p class="num">{{list_data[1].belowscore}}<Icon :type="list_data[1].icon_type" :class="list_data[1].icon_color" /></p>
  27. <p class="datatitle">{{list_data[1].below_title}}</p>
  28. </div>
  29. </li>
  30. <li class="subjects_listbox">
  31. <div class="top">
  32. <p class="num">{{list_data[2].score}}</p>
  33. <p class="datatitle">{{list_data[2].title}}</p>
  34. </div>
  35. <div class="center">
  36. <div id="myChart_three" :style="{width: '100%', height: '150px'}"></div>
  37. </div>
  38. <div class="bottom">
  39. <p class="num">{{list_data[2].belowscore}}<Icon :type="list_data[2].icon_type" :class="list_data[2].icon_color" /></p>
  40. <p class="datatitle">{{list_data[2].below_title}}</p>
  41. </div>
  42. </li>
  43. <li class="subjects_listbox">
  44. <div class="top">
  45. <p class="num">{{list_data[3].score}}</p>
  46. <p class="datatitle">{{list_data[3].title}}</p>
  47. </div>
  48. <div class="center">
  49. <div id="myChart_four" :style="{width: '100%', height: '150px'}"></div>
  50. </div>
  51. <div class="bottom">
  52. <p class="num">{{list_data[3].belowscore}}<Icon :type="list_data[3].icon_type" :class="list_data[3].icon_color" /></p>
  53. <p class="datatitle">{{list_data[3].below_title}}</p>
  54. </div>
  55. </li>
  56. <li class="subjects_listbox">
  57. <div class="top">
  58. <p class="num">{{list_data[4].score}}</p>
  59. <p class="datatitle">{{list_data[4].title}}</p>
  60. </div>
  61. <div class="center">
  62. <div id="myChart_five" :style="{width: '100%', height: '150px'}"></div>
  63. </div>
  64. <div class="bottom">
  65. <p class="num">{{list_data[4].belowscore}}<Icon :type="list_data[4].icon_type" :class="list_data[4].icon_color" /></p>
  66. <p class="datatitle">{{list_data[4].below_title}}</p>
  67. </div>
  68. </li>
  69. <li class="subjects_listbox">
  70. <div class="top">
  71. <p class="num">{{list_data[5].score}}</p>
  72. <p class="datatitle">{{list_data[5].title}}</p>
  73. </div>
  74. <div class="center">
  75. <div id="myChart_six" :style="{width: '100%', height: '150px'}"></div>
  76. </div>
  77. <div class="bottom">
  78. <p class="num">{{list_data[5].belowscore}}<Icon :type="list_data[5].icon_type" :class="list_data[5].icon_color" /></p>
  79. <p class="datatitle">{{list_data[5].below_title}}</p>
  80. </div>
  81. </li>
  82. </div>
  83. </template>
  84. <script>
  85. export default {
  86. name: "SubjectsManifestation",
  87. data(){
  88. return{
  89. list_data: [],
  90. }
  91. },
  92. created() {
  93. this.init();
  94. },
  95. mounted() {
  96. this.init();
  97. },
  98. computed:{
  99. // 命令发布监听
  100. inquiredata() {
  101. return this.$store.state.pie
  102. },
  103. },
  104. methods:{
  105. //图形一
  106. One(obj) {
  107. //this.$store.state.pie.mode = false;
  108. let myChart = this.$echarts.init(document.getElementById('myChart_one'));
  109. myChart.setOption({
  110. grid: {
  111. left: 0,
  112. top: 0,
  113. right: 0,
  114. bottom: 0
  115. },
  116. color: obj.color,
  117. series: [{
  118. type: 'pie',
  119. radius: ['80%', '97%'],
  120. hoverAnimation: false,
  121. label: {
  122. normal: {
  123. position: 'center'
  124. }
  125. },
  126. data: [{
  127. value: obj.occupy,
  128. name: '占有率',
  129. label: {
  130. normal: {
  131. rich: {
  132. a: {
  133. lineHeight: 10
  134. }
  135. },
  136. formatter: '{d}%',
  137. textStyle: {
  138. fontSize: 18,
  139. fontWeight: 'bold',
  140. color: '#555',
  141. height: 25,
  142. top: 1,
  143. }
  144. }
  145. }
  146. }, {
  147. value: obj.surplus,
  148. name: '不足',
  149. label: {
  150. normal: {
  151. rich: {
  152. a: {
  153. lineHeight: 5
  154. }
  155. },
  156. formatter: '\n' + obj.subject,
  157. textStyle: {
  158. color: '#555',
  159. fontSize: 15,
  160. height: 15,
  161. }
  162. }
  163. },
  164. tooltip: {
  165. show: false
  166. },
  167. itemStyle: {
  168. normal: {
  169. color: '#ddd'
  170. },
  171. emphasis: {
  172. color: '#ddd'
  173. }
  174. },
  175. hoverAnimation: false
  176. }]
  177. }]
  178. })
  179. },
  180. Two(obj){
  181. //this.$store.state.pie.mode = false;
  182. let myChart = this.$echarts.init(document.getElementById('myChart_two'));
  183. myChart.setOption({
  184. grid:{
  185. left:0,
  186. top:0,
  187. right:0,
  188. bottom:0
  189. },
  190. color: obj.color,
  191. series: [{
  192. type: 'pie',
  193. radius: ['80%', '97%'],
  194. hoverAnimation:false,
  195. label: {
  196. normal: {
  197. position: 'center'
  198. }
  199. },
  200. data: [{
  201. value: obj.occupy,
  202. name: '占有率',
  203. label: {
  204. normal: {
  205. rich:{
  206. a:{
  207. lineHeight: 10
  208. }
  209. },
  210. formatter: '{d}%',
  211. textStyle: {
  212. fontSize: 18,
  213. fontWeight:'bold',
  214. color:'#555',
  215. height:25,
  216. top:1,
  217. }
  218. }
  219. }
  220. }, {
  221. value: obj.surplus,
  222. name: '不足',
  223. label: {
  224. normal: {
  225. rich:{
  226. a:{
  227. lineHeight: 5
  228. }
  229. },
  230. formatter: '\n' + obj.subject,
  231. textStyle: {
  232. color: '#555',
  233. fontSize: 15,
  234. height:15,
  235. }
  236. }
  237. },
  238. tooltip: {
  239. show: false
  240. },
  241. itemStyle: {
  242. normal: {
  243. color: '#ddd'
  244. },
  245. emphasis: {
  246. color: '#ddd'
  247. }
  248. },
  249. hoverAnimation: false
  250. }]
  251. }]
  252. })
  253. },
  254. Three(obj){
  255. //this.$store.state.pie.mode = false;
  256. let myChart = this.$echarts.init(document.getElementById('myChart_three'));
  257. myChart.setOption({
  258. grid:{
  259. left:0,
  260. top:0,
  261. right:0,
  262. bottom:0
  263. },
  264. color: obj.color,
  265. series: [{
  266. type: 'pie',
  267. radius: ['80%', '97%'],
  268. hoverAnimation:false,
  269. label: {
  270. normal: {
  271. position: 'center'
  272. }
  273. },
  274. data: [{
  275. value: obj.occupy,
  276. name: '占有率',
  277. label: {
  278. normal: {
  279. rich:{
  280. a:{
  281. lineHeight: 10
  282. }
  283. },
  284. formatter: '{d}%',
  285. textStyle: {
  286. fontSize: 18,
  287. fontWeight:'bold',
  288. color:'#555',
  289. height:25,
  290. top:1,
  291. }
  292. }
  293. }
  294. }, {
  295. value: obj.surplus,
  296. name: '不足',
  297. label: {
  298. normal: {
  299. rich:{
  300. a:{
  301. lineHeight:5
  302. }
  303. },
  304. formatter: '\n' + obj.subject,
  305. textStyle: {
  306. color: '#555',
  307. fontSize: 15,
  308. height:15,
  309. }
  310. }
  311. },
  312. tooltip: {
  313. show: false
  314. },
  315. itemStyle: {
  316. normal: {
  317. color: '#ddd'
  318. },
  319. emphasis: {
  320. color: '#ddd'
  321. }
  322. },
  323. hoverAnimation: false
  324. }]
  325. }]
  326. })
  327. },
  328. Four(obj){
  329. //this.$store.state.pie.mode = false;
  330. let myChart = this.$echarts.init(document.getElementById('myChart_four'));
  331. myChart.setOption({
  332. grid:{
  333. left:0,
  334. top:0,
  335. right:0,
  336. bottom:0
  337. },
  338. color: obj.color,
  339. series: [{
  340. type: 'pie',
  341. radius: ['80%', '97%'],
  342. hoverAnimation:false,
  343. label: {
  344. normal: {
  345. position: 'center'
  346. }
  347. },
  348. data: [{
  349. value: obj.occupy,
  350. name: '占有率',
  351. label: {
  352. normal: {
  353. rich:{
  354. a:{
  355. lineHeight: 10
  356. }
  357. },
  358. formatter: '{d}%',
  359. textStyle: {
  360. fontSize: 18,
  361. fontWeight:'bold',
  362. color:'#555',
  363. height:25,
  364. top:1,
  365. }
  366. }
  367. }
  368. }, {
  369. value: obj.surplus,
  370. name: '不足',
  371. label: {
  372. normal: {
  373. rich:{
  374. a:{
  375. lineHeight:5
  376. }
  377. },
  378. formatter: '\n' + obj.subject,
  379. textStyle: {
  380. color: '#555',
  381. fontSize: 15,
  382. height:15,
  383. }
  384. }
  385. },
  386. tooltip: {
  387. show: false
  388. },
  389. itemStyle: {
  390. normal: {
  391. color: '#ddd'
  392. },
  393. emphasis: {
  394. color: '#ddd'
  395. }
  396. },
  397. hoverAnimation: false
  398. }]
  399. }]
  400. })
  401. },
  402. Five(obj){
  403. //this.$store.state.pie.mode = false;
  404. let myChart = this.$echarts.init(document.getElementById('myChart_five'));
  405. myChart.setOption({
  406. grid:{
  407. left:0,
  408. top:0,
  409. right:0,
  410. bottom:0
  411. },
  412. color:obj.color,
  413. series: [{
  414. type: 'pie',
  415. radius: ['80%', '97%'],
  416. hoverAnimation:false,
  417. label: {
  418. normal: {
  419. position: 'center'
  420. }
  421. },
  422. data: [{
  423. value: obj.occupy,
  424. name: '占有率',
  425. label: {
  426. normal: {
  427. rich:{
  428. a:{
  429. lineHeight: 10
  430. }
  431. },
  432. formatter: '{d}%',
  433. textStyle: {
  434. fontSize: 18,
  435. fontWeight:'bold',
  436. color:'#555',
  437. height:25,
  438. top:1,
  439. }
  440. }
  441. }
  442. }, {
  443. value: obj.surplus,
  444. name: '不足',
  445. label: {
  446. normal: {
  447. rich:{
  448. a:{
  449. lineHeight: 5
  450. }
  451. },
  452. formatter: '\n'+obj.subject ,
  453. textStyle: {
  454. color: '#555',
  455. fontSize: 15,
  456. height:15
  457. }
  458. }
  459. },
  460. tooltip: {
  461. show: false
  462. },
  463. itemStyle: {
  464. normal: {
  465. color: '#ddd'
  466. },
  467. emphasis: {
  468. color: '#ddd'
  469. }
  470. },
  471. hoverAnimation: false
  472. }]
  473. }]
  474. })
  475. },
  476. Six(obj){
  477. //this.$store.state.pie.mode = false;
  478. let myChart = this.$echarts.init(document.getElementById('myChart_six'));
  479. myChart.setOption({
  480. grid:{
  481. left:0,
  482. top:0,
  483. right:0,
  484. bottom:0
  485. },
  486. color: obj.color,
  487. series: [{
  488. type: 'pie',
  489. radius: ['80%', '97%'],
  490. hoverAnimation:false,
  491. label: {
  492. normal: {
  493. position: 'center'
  494. }
  495. },
  496. data: [{
  497. value: obj.occupy,
  498. name: '占有率',
  499. label: {
  500. normal: {
  501. rich:{
  502. a:{
  503. lineHeight: 10
  504. }
  505. },
  506. formatter: '{d}%',
  507. textStyle: {
  508. fontSize: 18,
  509. fontWeight:'bold',
  510. color:'#555',
  511. height:25,
  512. top:1,
  513. }
  514. }
  515. }
  516. }, {
  517. value: obj.surplus,
  518. name: '不足',
  519. label: {
  520. normal: {
  521. rich:{
  522. a:{
  523. lineHeight: 5
  524. }
  525. },
  526. formatter: '\n' + obj.subject,
  527. textStyle: {
  528. color: '#555',
  529. fontSize: 15,
  530. height:15,
  531. }
  532. }
  533. },
  534. tooltip: {
  535. show: false
  536. },
  537. itemStyle: {
  538. normal: {
  539. color: '#ddd'
  540. },
  541. emphasis: {
  542. color: '#ddd'
  543. }
  544. },
  545. hoverAnimation: false
  546. }]
  547. }]
  548. })
  549. },
  550. init() {
  551. let _this = this;
  552. this.$api.FindSubjectsManifestation({})
  553. .then((response) => {
  554. //console.log(response.result.data, 8888888);
  555. //this.One(response.result.data);
  556. _this.$store.state.pie = response.result.data;
  557. //_this.Two(response.result.data[1]);
  558. //_this.Three(response.result.data[2]);
  559. //_this.Four(response.result.data[3]);
  560. //_this.Five(response.result.data[4]);
  561. //_this.Six(response.result.data[5]);
  562. })
  563. }
  564. },
  565. watch:{
  566. // 监听指令
  567. inquiredata(value){
  568. if(value){
  569. this.list_data = value;
  570. let dataone= value[0];
  571. let datatwo = value[1];
  572. let datathree = value[2];
  573. let datafour = value[3];
  574. let datafive = value[4];
  575. let datasix = value[5];
  576. this.One(dataone);
  577. this.Two(datatwo);
  578. this.Three(datathree);
  579. this.Four(datafour);
  580. this.Five(datafive);
  581. this.Six(datasix);
  582. }
  583. },
  584. }
  585. }
  586. </script>