teacherMap.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. <template>
  2. <div class="content">
  3. <div class="map">
  4. <div id="myChart" :style="{width: '600px', height: '600px'}"></div>
  5. </div>
  6. <div class="teacher-show">
  7. <div class="header">
  8. <h1 class="title ">全国名师展示</h1>
  9. <ul class="region">
  10. <li><a href="" class="active" rel="all">全部</a></li>
  11. <li><a href="" rel="330000" class="">浙江省</a></li>
  12. <li><a href="" rel="440000" class="">广东省</a></li>
  13. <li><a href="" rel="210000" class="">辽宁省</a></li>
  14. <li><a href="" rel="350000" class="">福建省</a></li>
  15. </ul>
  16. </div>
  17. <div class="select">
  18. <Select v-model="model1" placeholder="学段" style="width:100px">
  19. <Option v-for="item in periodList" :value="item.value" :key="item.value">{{ item.label }}</Option>
  20. </Select>
  21. <Select v-model="model1" placeholder="学科" style="width:100px">
  22. <Option v-for="item in subjectList" :value="item.value" placeholder="学科" :key="item.value">{{ item.label }}</Option>
  23. </Select>
  24. </div>
  25. <div class="content-buttom">
  26. <div class="teacher-item" style="cursor: pointer" v-for="item in teacherList">
  27. <div class="t-title">
  28. <span>{{item.provice}}</span>
  29. <span>
  30. {{item.title}}
  31. </span>
  32. </div>
  33. <div class="img-content">
  34. <img src="http://www.wuhaneduyun.cn/uploads/snsPhotos/snscover/2019/0330/262/5c9f1ffb2b06c.png_00494494_200x200.jpg" class="th_pto">
  35. </div>
  36. <div class="teacher-info">
  37. <p class="name">{{item.name}}</p>
  38. <div class="subject">
  39. <p>{{item.period}}<span></span>{{item.subject}}</p>
  40. </div>
  41. </div>
  42. <div class="teacher-detailed">
  43. <div class="item">
  44. <p class="number">{{item.number1}}</p>
  45. <p class="txt">{{item.text1}}</p>
  46. </div>
  47. <div class="item">
  48. <p class="number">{{item.number2}}</p>
  49. <p class="txt">{{item.text2}}</p>
  50. </div>
  51. <div class="item">
  52. <p class="number">{{item.number3}}</p>
  53. <p class="txt">{{item.text3}}</p>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <div class="data-view">
  60. <div class="four">
  61. <img src="https://css.huijiaoyun.com/tianyu_edu/html_other_edu/cd_good_school/images/four.png" alt="">
  62. </div>
  63. <div class="resource-data">
  64. <div class="data-item">
  65. <div class="img-content">
  66. <span class="data-view-teacher"></span>
  67. </div>
  68. <p class="data-name">名师总数</p>
  69. <p class="number">13201</p>
  70. </div>
  71. <div class="data-item">
  72. <div class="img-content">
  73. <span class="data-view-member"></span>
  74. </div>
  75. <p class="data-name">成员总数</p>
  76. <p class="number">579260</p>
  77. </div>
  78. <div class="data-item">
  79. <div class="img-content">
  80. <span class="data-view-article"></span>
  81. </div>
  82. <p class="data-name">文章总数</p>
  83. <p class="number">1561686</p>
  84. </div>
  85. <div class="data-item">
  86. <div class="img-content">
  87. <span class="data-view-active"></span>
  88. </div>
  89. <p class="data-name">活动总数</p>
  90. <p class="number">38792</p>
  91. </div>
  92. <div class="data-item">
  93. <div class="img-content">
  94. <span class="data-view-resource"></span>
  95. </div>
  96. <p class="data-name">资源总数</p>
  97. <p class="number">1428690</p>
  98. </div>
  99. <div class="data-item">
  100. <div class="img-content">
  101. <span class="data-view-move"></span>
  102. </div>
  103. <p class="data-name">优课总数</p>
  104. <p class="number">234346</p>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </template>
  110. <script>
  111. import echarts from 'echarts'
  112. import '../../static/china.js' // 引入中国地图数据
  113. // import 'echarts/map/js/china.js';
  114. export default {
  115. data() {
  116. return {
  117. chart: null,
  118. data: [],
  119. total: 0,
  120. model1:'',
  121. periodList: [
  122. {
  123. value: 1,
  124. label: '学前'
  125. },
  126. {
  127. value: 2,
  128. label: '小学'
  129. },
  130. {
  131. value: 3,
  132. label: '初中'
  133. },
  134. {
  135. value: 4,
  136. label: '高中'
  137. },
  138. {
  139. value: 5,
  140. label: '中职'
  141. },
  142. ],
  143. subjectList: [
  144. {
  145. value: 1,
  146. label: '语文'
  147. },
  148. {
  149. value: 2,
  150. label: '数学'
  151. },
  152. {
  153. value: 3,
  154. label: '英语'
  155. },
  156. {
  157. value: 4,
  158. label: '生物'
  159. },
  160. {
  161. value:5,
  162. label: '化学'
  163. },
  164. ],
  165. teacherList: [
  166. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500'},
  167. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  168. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  169. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  170. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  171. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  172. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  173. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  174. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  175. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  176. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  177. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  178. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  179. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  180. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  181. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  182. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  183. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  184. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  185. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  186. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  187. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  188. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  189. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  190. { provice: '四川', subject: '语文', title: '省级名师', name: '周一', period: '小学', text1: '成员', number1: '1000', text2: '资源', number2: '2000', text3: '热度', number3: '1500' },
  191. ],
  192. geoCoordMap: {
  193. "四川省": [104.06, 30.67],
  194. "陕西省": [108.78, 34.40],
  195. "浙江省": [120.04, 30.35],
  196. "广东省": [113.23, 23.22],
  197. "湖北省": [114.12, 30.76],
  198. "宁夏回族自治区": [106.09, 38.62],
  199. "河南省": [113.45, 34.90],
  200. "黑龙江省": [126.48, 45.99],
  201. "甘肃省": [103.67, 36.22],
  202. "河北省": [114.34, 38.22],
  203. "北京市": [116.40, 39.94],
  204. "江苏省": [118.72, 32.24],
  205. "辽宁省": [123.24, 41.95],
  206. "吉林省": [125.23, 43.90],
  207. "安徽省": [117.17, 31.99],
  208. "福建省": [119.16, 26.18],
  209. "江西省": [115.80, 28.77],
  210. "山东省": [116.91, 36.81],
  211. "湖南省": [112.80, 28.47],
  212. "海南省": [110.18, 19.92],
  213. "贵州省": [106.49, 26.84],
  214. "云南省": [102.59, 25.25],
  215. "青海省": [101.60, 36.75],
  216. "西藏自治区": [90.97, 29.84],
  217. },
  218. };
  219. },
  220. mounted() {
  221. this.drawLine();
  222. },
  223. methods: {
  224. convertData(data) {
  225. var res = [];
  226. for (var i = 0; i < 5; i++) {
  227. var geoCoord = this.geoCoordMap[[i]];
  228. if (geoCoord) {
  229. res.push({
  230. name: data[i].name,
  231. value: geoCoord.concat(data[i].value)
  232. });
  233. }
  234. }
  235. return res;
  236. },
  237. drawLine () {
  238. // 基于准备好的dom,初始化echarts实例
  239. let myChart = echarts.init(document.getElementById('myChart'))
  240. var option = {
  241. backgroundColor: '',
  242. title: {
  243. //text: '全国教师使用情况统计图',
  244. left: 'center',
  245. top: '8%',
  246. textStyle: {
  247. color: 'black',
  248. fontSize: '22'
  249. }
  250. },
  251. tooltip: {
  252. trigger: 'item',
  253. formatter: function (params) {
  254. return params.name + '<br/>' +
  255. params.seriesName + ": " + params.value[2]
  256. }
  257. },
  258. legend: {
  259. orient: 'vertical',
  260. y: 'bottom',
  261. x: 'right',
  262. data: ['全国报名情况'],
  263. textStyle: {
  264. color: 'green'
  265. }
  266. },
  267. geo: {
  268. map: 'china',
  269. label: {
  270. emphasis: {
  271. show: false
  272. }
  273. },
  274. roam: false,
  275. itemStyle: {
  276. normal: {
  277. areaColor: 'white',
  278. borderColor: '#81ADDC'
  279. },
  280. emphasis: {
  281. areaColor: 'lightgreen'
  282. }
  283. }
  284. },
  285. series: [
  286. {
  287. name: '报名人数',
  288. type: 'scatter',
  289. coordinateSystem: 'geo',
  290. data: this.convertData(this.data),
  291. symbolSize: function (val) {
  292. return val[2] / 4;
  293. },
  294. label: {
  295. normal: {
  296. formatter: '{b}',
  297. position: 'right',
  298. show: true
  299. },
  300. emphasis: {
  301. show: true
  302. }
  303. },
  304. itemStyle: {
  305. normal: {
  306. color: '#ddb926'
  307. }
  308. }
  309. },
  310. {
  311. name: '报名人数',
  312. type: 'effectScatter',
  313. coordinateSystem: 'geo',
  314. data: this.convertData(this.data.sort(function (a, b) {
  315. return b.value - a.value;
  316. }).slice(0, 5)),
  317. symbolSize: function (val) {
  318. return val[2] / 6;
  319. },
  320. showEffectOn: 'render',
  321. rippleEffect: {
  322. brushType: 'fill'
  323. },
  324. hoverAnimation: true,
  325. label: {
  326. normal: {
  327. formatter: '{b}',
  328. position: 'right',
  329. show: true
  330. }
  331. },
  332. itemStyle: {
  333. normal: {
  334. color: '#f4e925',
  335. shadowBlur: 16,
  336. shadowColor: '#333'
  337. }
  338. },
  339. zlevel: 1
  340. }
  341. ]
  342. }
  343. // 绘制图表
  344. myChart.setOption(option);
  345. }
  346. },
  347. }
  348. </script>
  349. <style scoped>
  350. .map {
  351. width: 100%;
  352. height: 600px;
  353. /*margin-left:150px;*/
  354. padding-left: 250px;
  355. background: url("../../assets/image/resource/title-bg.jpg") center 120% no-repeat;
  356. }
  357. .header {
  358. width: 100%;
  359. height: 56px;
  360. margin:auto;
  361. -webkit-box-sizing: border-box;
  362. box-sizing: border-box;
  363. border-bottom: 1px solid #e4e4e4;
  364. }
  365. .title {
  366. font-size: 32px;
  367. line-height: 56px;
  368. color: #000;
  369. float:left;
  370. }
  371. .region {
  372. width: 580px;
  373. margin-left: 60px;
  374. float: left;
  375. }
  376. .region li {
  377. float: left;
  378. margin-right: 60px;
  379. margin-top: 12px;
  380. font-weight:700;
  381. font-size: 20px;
  382. list-style:none;
  383. }
  384. .region li a:hover {
  385. color: #1a89e3;
  386. border-bottom: 2px solid #1a89e3;
  387. }
  388. .region li a {
  389. display: inline-block;
  390. line-height: 36px;
  391. color: #888;
  392. padding-bottom: 6px;
  393. }
  394. .teacher-show {
  395. width: 1200px;
  396. height: 1228px;
  397. margin: 45px auto auto;
  398. -webkit-box-sizing: border-box;
  399. box-sizing: border-box;
  400. }
  401. .select {
  402. float: right;
  403. margin-top: -3%;
  404. }
  405. .content-buttom {
  406. width: 1200px;
  407. height: 1228px;
  408. }
  409. .teacher-item {
  410. width: 222px;
  411. height: 313px;
  412. -webkit-box-sizing: border-box;
  413. box-sizing: border-box;
  414. -webkit-border-radius: 4px;
  415. border-radius: 4px;
  416. border: 1px solid #ececec;
  417. -webkit-box-shadow: 1px 1px 10px #ececec;
  418. box-shadow: 1px 1px 10px #ececec;
  419. margin-bottom: 20px;
  420. background: #fff;
  421. float: left;
  422. margin-left: 1%;
  423. margin-top: 1%;
  424. }
  425. .t-title {
  426. display: -webkit-box;
  427. display: -webkit-flex;
  428. display: -ms-flexbox;
  429. display: flex;
  430. -webkit-box-pack: justify;
  431. -webkit-justify-content: space-between;
  432. -ms-flex-pack: justify;
  433. justify-content: space-between;
  434. }
  435. .t-title span {
  436. display: inline-block;
  437. line-height: 20px;
  438. font-size: 16px;
  439. color: #555;
  440. margin: 20px;
  441. }
  442. .img-content {
  443. width: 100%;
  444. height: 100px;
  445. display: -webkit-box;
  446. display: -webkit-flex;
  447. display: -ms-flexbox;
  448. display: flex;
  449. }
  450. .th_pto {
  451. width: 100px;
  452. height: 100px;
  453. border-radius: 50%;
  454. margin: 0 auto;
  455. position: relative;
  456. }
  457. .teacher-info {
  458. width: 100%;
  459. height: 70px;
  460. text-align: center;
  461. margin-top: 22px;
  462. }
  463. .teacher-info .name {
  464. font-size: 18px;
  465. line-height: 30px;
  466. font-weight: bold;
  467. }
  468. .teacher-info .subject {
  469. width: 116px;
  470. height: 24px;
  471. margin: 0 auto;
  472. -webkit-border-radius: 20px;
  473. border-radius: 20px;
  474. background: -webkit-gradient(linear, left top, right top, from(#29cff7), to(#4ae3c7));
  475. background: -webkit-linear-gradient(left, #29cff7, #4ae3c7);
  476. background: -o-linear-gradient(left, #29cff7, #4ae3c7);
  477. background: linear-gradient(to right, #29cff7, #4ae3c7);
  478. }
  479. .teacher-info .subject p span {
  480. display: inline-block;
  481. width: 4px;
  482. height: 4px;
  483. -webkit-border-radius: 50%;
  484. border-radius: 50%;
  485. margin-top: 10px;
  486. background: #fff;
  487. margin: 3px 6px;
  488. }
  489. .teacher-detailed {
  490. width: 100%;
  491. height: 60px;
  492. margin-top: 8px;
  493. display: -webkit-box;
  494. display: -webkit-flex;
  495. display: -ms-flexbox;
  496. display: flex;
  497. -webkit-justify-content: space-around;
  498. -ms-flex-pack: distribute;
  499. justify-content: space-around;
  500. }
  501. .item .txt {
  502. color: #888;
  503. }
  504. .data-view {
  505. width: 100%;
  506. height: 663px;
  507. overflow: hidden;
  508. background: url('../../assets/image/resource/data-view-bg.png') no-repeat center center;
  509. }
  510. .four {
  511. width: 409px;
  512. height: 248px;
  513. overflow: hidden;
  514. margin: 40px auto;
  515. }
  516. .four img {
  517. width: 409px;
  518. }
  519. .ewm_img {
  520. width: 79.5%;
  521. height: 300px;
  522. text-align: right;
  523. position: absolute;
  524. top: 2128px;
  525. left: 0px;
  526. }
  527. .ewm_img img {
  528. width: 150px;
  529. height: 150px;
  530. }
  531. .ewm_text {
  532. font-size: 17px;
  533. color: #fff;
  534. margin-top: 10px;
  535. }
  536. .resource-data {
  537. width: 1100px;
  538. height: 130px;
  539. -webkit-box-sizing: border-box;
  540. box-sizing: border-box;
  541. margin: 130px auto 0;
  542. display: -webkit-box;
  543. display: -webkit-flex;
  544. display: -ms-flexbox;
  545. display: flex;
  546. -webkit-justify-content: space-around;
  547. -ms-flex-pack: distribute;
  548. justify-content: space-around;
  549. }
  550. .data-item {
  551. width: 130px;
  552. height: 100%;
  553. }
  554. .img-content {
  555. width: 60px;
  556. height: 60px;
  557. margin: 25px auto 17px;
  558. text-align: center;
  559. }
  560. .data-view-teacher {
  561. width: 43px;
  562. height: 51px;
  563. margin-top: 4px;
  564. background: url('../../assets/image/resource/data-view-teacher.png') no-repeat;
  565. }
  566. .data-view-member {
  567. width: 54px;
  568. height: 33px;
  569. margin-top: 13px;
  570. background: url('../../assets/image/resource/data-view-member.png') no-repeat;
  571. }
  572. .data-view-article {
  573. width: 46px;
  574. height: 50px;
  575. margin-top: 4px;
  576. background: url('../../assets/image/resource/data-view-article.png') no-repeat;
  577. }
  578. .data-view-active {
  579. width: 44px;
  580. height: 50px;
  581. margin-top: 4px;
  582. background: url('../../assets/image/resource/data-view-active.png') no-repeat;
  583. }
  584. .data-view-resource {
  585. width: 46px;
  586. height: 50px;
  587. margin-top: 4px;
  588. background: url('../../assets/image/resource/data-view-resource.png') no-repeat;
  589. }
  590. .data-view-move {
  591. width: 52px;
  592. height: 50px;
  593. margin-top: 4px;
  594. background: url('../../assets/image/resource/data-view-move.png') no-repeat;
  595. }
  596. .data-name {
  597. font-size: 18px;
  598. color: #555;
  599. }
  600. .number {
  601. font-size: 24px;
  602. color: #000;
  603. }
  604. </style>