EducationPage.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <div id="educationPage">
  3. <tr id="schoolStatus">在校生情况</tr>
  4. <div id="table_head">
  5. <td id="td1">类型</td>
  6. <td id="td2">人数</td>
  7. <td id="td3">比例</td>
  8. </div>
  9. <div id="table_body">
  10. <tr id="tr_class">
  11. <td class="educate_type">学龄前</td>
  12. <td class="educate_num">{{xlq?xlq.num:0}}</td>
  13. <td class="educate_num1">{{xlq?xlq.rate:0}}%</td>
  14. </tr>
  15. <tr id="tr_class1">
  16. <td class="educate_type">小学</td>
  17. <td class="educate_num">{{xx?xx.num:0}}</td>
  18. <td class="educate_num1">{{xx?xx.rate:0}}%</td>
  19. </tr>
  20. <tr class="tr_class">
  21. <td class="educate_type">初中</td>
  22. <td class="educate_num">{{cz?cz.num:0}}</td>
  23. <td class="educate_num1">{{cz?cz.rate:0}}%</td>
  24. </tr>
  25. <tr class="tr_class">
  26. <td class="educate_type">高中</td>
  27. <td class="educate_num">{{gz?gz.num:0}}</td>
  28. <td class="educate_num1">{{gz?gz.rate:0}}%</td>
  29. </tr>
  30. <tr class="tr_class">
  31. <td class="educate_type">大学</td>
  32. <td class="educate_num">{{dx?dx.num:0}}</td>
  33. <td class="educate_num1">{{dx?dx.rate:0}}%</td>
  34. </tr>
  35. <tr class="tr_class" id="tr6">
  36. <td class="educate_type">研究生及以上</td>
  37. <td class="educate_num">{{yjs?yjs.num:0}}</td>
  38. <td class="educate_num1">{{yjs?yjs.rate:0}}%</td>
  39. </tr>
  40. <div id="back_div1">
  41. </div>
  42. <div id="back_div2">
  43. </div>
  44. <div id="back_div3">
  45. </div>
  46. </div>
  47. <tr id="educate_distribution">教育程度分布</tr>
  48. <div id="educate_chart">
  49. <ThreeDCharts></ThreeDCharts>
  50. </div>
  51. </div>
  52. </template>
  53. <script>
  54. import ThreeDCharts from "../Utils/ThreeDCharts1.vue"
  55. export default {
  56. name: 'EducationPage',
  57. components:{
  58. ThreeDCharts
  59. },
  60. data () {
  61. return {
  62. school: [
  63. {
  64. rate: 8.73,
  65. num: 2101,
  66. name: "学龄前",
  67. id: 1513
  68. },
  69. {
  70. rate: 15.79,
  71. num: 3800,
  72. name: "小学",
  73. id: 1514
  74. },
  75. {
  76. rate: 13.44,
  77. num: 3235,
  78. name: "初中",
  79. id: 1559
  80. },
  81. {
  82. rate: 29.65,
  83. num: 7136,
  84. name: "高中",
  85. id: 1515
  86. },
  87. {
  88. rate: 32.07,
  89. num: 7718,
  90. name: "大学",
  91. id: 1516
  92. },
  93. {
  94. rate: 0.32,
  95. num: 78,
  96. name: "研究生及以上",
  97. id: 1517
  98. }
  99. ],
  100. xlq:0
  101. ,xx:0,cz:0,gz:0,dx:0,yjs:0
  102. }
  103. },
  104. mounted(){
  105. let clear= setInterval(() => {
  106. if(this.$store.getters.getSzdata.code===10000&&this.$store.getters.getSzdata.data.school) {
  107. this.school=this.$store.getters.getSzdata.data.school
  108. console.log(this.$store.getters.getSzdata.data)
  109. this.school.map(obj=>{
  110. if(obj.name=="学龄前"){
  111. this.xlq={
  112. num:obj.num,
  113. rate:obj.rate
  114. }
  115. }else if(obj.name=="小学"){
  116. this.xx={
  117. num:obj.num,
  118. rate:obj.rate
  119. }
  120. }else if(obj.name=="初中"){
  121. this.cz={
  122. num:obj.num,
  123. rate:obj.rate
  124. }
  125. }else if(obj.name=="高中"){
  126. this.gz={
  127. num:obj.num,
  128. rate:obj.rate
  129. }
  130. }else if(obj.name=="大学"){
  131. this.dx={
  132. num:obj.num,
  133. rate:obj.rate
  134. }
  135. }else if(obj.name=="研究生及以上"){
  136. this.yjs={
  137. num:obj.num,
  138. rate:obj.rate
  139. }
  140. }
  141. })
  142. clearInterval(clear)
  143. }
  144. }, 500);
  145. },
  146. methods:{
  147. }
  148. }
  149. </script>
  150. <style scoped>
  151. #back_div1{
  152. position: absolute;
  153. width: 100%;
  154. height: 16%;
  155. background-color:rgb(96, 136, 206,0.2) ;
  156. top:14%;
  157. }
  158. #back_div2{
  159. position: absolute;
  160. width: 100%;
  161. height: 16%;
  162. background-color:rgb(96, 136, 206,0.2) ;
  163. top:44%;
  164. }
  165. #back_div3{
  166. position: absolute;
  167. width: 100%;
  168. height: 16%;
  169. background-color:rgb(96, 136, 206,0.2) ;
  170. top:73%;
  171. }
  172. .educate_num{
  173. position: absolute;
  174. width: 10%;
  175. left: 45%;
  176. }
  177. .educate_num1{
  178. position: absolute;
  179. width: 30%;
  180. left: 65%;
  181. }
  182. #td1{
  183. font-weight:bold;
  184. position: absolute;
  185. left:10%;
  186. top:15%
  187. }
  188. #td2{
  189. font-weight:bold;
  190. position: absolute;
  191. left:45%;
  192. top:15%
  193. }
  194. #td3{
  195. font-weight:bold;
  196. position: absolute;
  197. left:75%;
  198. top:15%
  199. }
  200. #educationPage{
  201. position: absolute;
  202. width: 100%;
  203. height: 25%;
  204. top:52%;
  205. }
  206. #schoolStatus{
  207. position: absolute;
  208. font-family: "宋体";
  209. font-weight:bold;
  210. left:18%
  211. }
  212. #table_head{
  213. position: absolute;
  214. background-color:rgb(10,98,197) ;
  215. font-size: 13px;
  216. top:10%;
  217. width: 40%;
  218. height: 12%;
  219. left: 13%;
  220. }
  221. #table_body{
  222. position: absolute;
  223. font-size: 10px;
  224. left:13%;
  225. top:25%;
  226. width: 40%;
  227. height: 70%;
  228. background-color: rgb(10,98,197,0.1);
  229. text-align:center;
  230. line-height:25px
  231. }
  232. #educate_distribution{
  233. position: absolute;
  234. font-family: "宋体";
  235. font-weight:bold;
  236. left:58%
  237. }
  238. #educate_chart{
  239. position: absolute;
  240. height: 100%;
  241. width: 50%;
  242. left: 55%;
  243. /* background-color: rgb(10,98,197,0.2); */
  244. }
  245. @media screen and (max-height: 1000px) {
  246. #back_div1{
  247. position: absolute;
  248. width: 100%;
  249. height: 20%;
  250. background-color:rgb(96, 136, 206,0.2) ;
  251. top:16%;
  252. }
  253. #back_div2{
  254. position: absolute;
  255. width: 100%;
  256. height: 20%;
  257. background-color:rgb(96, 136, 206,0.2) ;
  258. top:49%;
  259. }
  260. #back_div3{
  261. position: absolute;
  262. width: 100%;
  263. height: 20%;
  264. background-color:rgb(96, 136, 206,0.2) ;
  265. top:85%;
  266. }
  267. .educate_num{
  268. position: absolute;
  269. width: 10%;
  270. left: 45%;
  271. }
  272. .educate_num1{
  273. position: absolute;
  274. width: 30%;
  275. left: 65%;
  276. }
  277. #td1{
  278. font-weight:bold;
  279. position: absolute;
  280. left:10%;
  281. top:15%
  282. }
  283. #td2{
  284. font-weight:bold;
  285. position: absolute;
  286. left:45%;
  287. top:15%
  288. }
  289. #td3{
  290. font-weight:bold;
  291. position: absolute;
  292. left:75%;
  293. top:15%
  294. }
  295. #educationPage{
  296. position: absolute;
  297. width: 100%;
  298. height: 25%;
  299. top:52%;
  300. }
  301. #schoolStatus{
  302. position: absolute;
  303. font-family: "宋体";
  304. font-weight:bold;
  305. left:18%
  306. }
  307. #table_head{
  308. position: absolute;
  309. background-color:rgb(10,98,197) ;
  310. font-size: 13px;
  311. top:10%;
  312. width: 40%;
  313. height: 12%;
  314. left: 13%;
  315. }
  316. #table_body{
  317. position: absolute;
  318. font-size: 10px;
  319. left:13%;
  320. top:25%;
  321. width: 40%;
  322. height: 70%;
  323. background-color: rgb(10,98,197,0.1);
  324. text-align:center;
  325. line-height:25px
  326. }
  327. #educate_distribution{
  328. position: absolute;
  329. font-family: "宋体";
  330. font-weight:bold;
  331. left:58%
  332. }
  333. #educate_chart{
  334. position: absolute;
  335. height: 100%;
  336. width: 50%;
  337. left: 55%;
  338. /* background-color: rgb(10,98,197,0.2); */
  339. }
  340. }
  341. </style>