大湾社区城市书房智慧大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1490 lines
52 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <div class="map-wrapper">
  3. <div class="map-content">
  4. <!-- 左边图书馆基本信息 -->
  5. <div class="lib-info">
  6. <div class="database-title big-title" style="font-size: .47rem !important;">{{ libCurrent && libCurrent.name }}</div>
  7. <div class="lib-content">
  8. <div style="width: 5.175rem; height: 3rem; overflow: hidden;">
  9. <swiper v-if="swiperOption" :key="swiperKey" ref="mySwiper" class="swiperLib" :options="swiperOption">
  10. <swiper-slide v-for="(item,index) in displayedImages" :key="index">
  11. <div class="book-img" style="width: 100%; height: 3rem;">
  12. <img :src="item.cover" :onerror="defaultImg" style="width: 100%;">
  13. </div>
  14. </swiper-slide>
  15. <!-- 标页码 -->
  16. <div slot="pagination" class="swiper-pagination" />
  17. </swiper>
  18. </div>
  19. <ul class="lib-cont-item lib-cont01">
  20. <li>
  21. <img src="@/assets/images/map_18.png" alt="">
  22. <p>
  23. <span>藏书量</span>
  24. <span>{{ libCurrent && libCurrent.GCL }}<i></i></span>
  25. </p>
  26. </li>
  27. <li>
  28. <img src="@/assets/images/map_20.png" alt="">
  29. <p>
  30. <span>办证量</span>
  31. <span>{{ libCurrent && (libCurrent.countCard ? libCurrent.countCard : libCurrent.readerIdNum) }}<i></i></span>
  32. </p>
  33. </li>
  34. </ul>
  35. <ul class="lib-cont-item lib-cont02">
  36. <li>
  37. <img src="@/assets/images/map_28.png" alt="">
  38. <p>
  39. <span>占地面积</span>
  40. <span>{{ libCurrent && libCurrent.occupationArea }}<i>平方米</i></span>
  41. </p>
  42. </li>
  43. </ul>
  44. <div ref="scrollInfo" class="scroll-container">
  45. <div ref="marquee" class="lib-text" v-html="libCurrent && libCurrent.explain" />
  46. </div>
  47. </div>
  48. </div>
  49. <!-- map -->
  50. <div ref="chart" style="width: 920px; height: 924px; z-index: 999; border:1px solid rgba(0, 0, 0, 0);" />
  51. <div class="map-hx-bg">
  52. <div class="map-hx-small" />
  53. <div class="map-hx-big" />
  54. </div>
  55. <!-- 右边排行榜 -->
  56. <div class="read-num">
  57. <div class="database-title">读者统计</div>
  58. <div class="online">
  59. <p>本年累计办证人数</p>
  60. <p class="num"><span>{{ cardTotal }}</span><i></i></p>
  61. </div>
  62. <div class="lending-ranking" style="padding: 0;">
  63. <!-- <h5>借阅Top10</h5> -->
  64. <div class="database-title" style="margin-bottom: 20px;">读者借阅排行榜</div>
  65. <div class="ranking-cont" style="margin: 0.25rem 0.375rem 0 0.3125rem;">
  66. <ul class="ranking-title">
  67. <li style="width: 0.8rem;">排名</li>
  68. <li style="width: 1.25rem; text-align: left; ">姓名</li>
  69. <li style="flex:1;" />
  70. <li style="width: 1.75rem; text-align: right; padding-right: .25rem;">借阅次数</li>
  71. </ul>
  72. <ul class="ranking-list" style="padding-top: 10px;">
  73. <li v-for="(item,index) in rankingWithPercentage" :key="index" :class="{ 'hovered': index === currentHover }" style="font-size: .28rem !important; line-height: 36px !important;">
  74. <div style="width: 1rem; color: #79B8FF;" :class="[{'ranking-num1':index===0},{'ranking-num2':index===1},{'ranking-num3':index===2}]">{{ index>=3 ? index+1 : null }}</div>
  75. <div style="width: 1.25rem; text-align: left; ">{{ item.RDNAME }}</div>
  76. <div class="ranking-progress" style="flex:1; align-self: center;">
  77. <el-progress :percentage="item.percentage" :stroke-width="8" :show-text="false" color="#009afb" />
  78. </div>
  79. <div style="width: 1.75rem; text-align: right; padding-right: .25rem;">{{ item.TOTALNUM }}<i></i></div>
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import { FetchLibBookTotal, FetchUsertotal, FetchLibcodeDetails, FetchLibcodeResouceDetails, FetchReadRanking, FetchLendingTotal } from '@/api/library'
  90. import mapJson from '@/assets/json/qy.json'
  91. import libJson from '@/assets/json/lib.json'
  92. import { debounce } from 'lodash' // js工具类,按需加载
  93. import { swiper, swiperSlide } from 'vue-awesome-swiper'
  94. import 'swiper/dist/css/swiper.css'
  95. export default {
  96. name: 'Map',
  97. components: {
  98. swiper, swiperSlide
  99. },
  100. data() {
  101. return {
  102. currentHover: -1,
  103. timeTicket: null,
  104. defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
  105. count: 0,
  106. len: 0, // 轮播数组的长度, 通过 count % len 可以得到[0, len-1] 数组下标
  107. libALLNum: [],
  108. libInfoData: [],
  109. libIndex: 0,
  110. libCurrent: null,
  111. swiperKey: 1,
  112. currentIndex: 0,
  113. displayedImages: [],
  114. libImg: [],
  115. swiperOption: null,
  116. seriesData: [],
  117. mapImg: require('../../assets/images/map-bg2.png'),
  118. cardTotal: 0,
  119. rankingData: [],
  120. rankingWithPercentage: [],
  121. rankInterval: null,
  122. timer: null,
  123. position: 0,
  124. speed: 2 // 滚动速度,可根据需要调整
  125. }
  126. },
  127. computed: {
  128. swiper() {
  129. return this.$refs.mySwiper.swiper
  130. }
  131. },
  132. beforeDestroy() {
  133. this.destroy()
  134. },
  135. created() {
  136. this.getLibBookTotal()
  137. this.getReadRanking()
  138. this.getLendingTotal()
  139. },
  140. activated() {
  141. this.getLibBookTotal()
  142. if (this.rankingData.length !== 0) {
  143. this.currentHover = -1
  144. this.rankInterval = setInterval(() => {
  145. this.currentHover = (this.currentHover + 1) % this.rankingData.length
  146. }, 1000)
  147. }
  148. this.$nextTick(() => {
  149. window.addEventListener('resize', debounce(this.resize, 2000))
  150. })
  151. },
  152. deactivated() {
  153. this.destroy()
  154. },
  155. mounted() {
  156. },
  157. methods: {
  158. destroy() {
  159. window.removeEventListener('resize', this.resize)
  160. clearTimeout(this.timeTicket)
  161. clearInterval(this.rankInterval)
  162. clearInterval(this.timer)
  163. // localStorage.setItem('libIndexItem', this.libIndex)
  164. // localStorage.setItem('libCurrentItem', this.libCurrent)
  165. localStorage.setItem('countItem', this.count)
  166. this.rankInterval = null
  167. this.timer = null
  168. this.timeTicket = null
  169. },
  170. startScrolling() {
  171. this.$nextTick(() => {
  172. const containerHeight = this.$refs.scrollInfo.offsetHeight
  173. const contentHeight = this.$refs.marquee.offsetHeight
  174. // 设置 CSS 变量 --container-height,以便在 CSS 中使用
  175. this.$refs.marquee.parentElement.style.setProperty('--container-height', `${contentHeight + 30}px`)
  176. if (contentHeight > containerHeight) {
  177. this.$refs.marquee.classList.add('lib-animation')
  178. } else {
  179. this.$refs.marquee.classList.remove('lib-animation')
  180. }
  181. })
  182. },
  183. getReadRanking() {
  184. const currentDate = new Date() // 获取当前日期
  185. currentDate.setDate(currentDate.getDate() - 30) // 将当前日期减去30天
  186. const year = currentDate.getFullYear() // 获取年份
  187. const month = currentDate.getMonth() + 1 // 获取月份(注意月份从0开始,需要加1)
  188. const day = currentDate.getDate() // 获取日期
  189. const formattedDate = `${year}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day}`
  190. const params = {
  191. 'libcode': this.libcode,
  192. 'starttime': formattedDate,
  193. 'endtime': this.getFormattedDate(new Date()),
  194. 'rownum': 10,
  195. 'nordtype': 'QYTSG_E'
  196. }
  197. FetchReadRanking(params).then(res => {
  198. const result = JSON.parse(res.data)
  199. if (result.success && result.resultlist.length > 0) {
  200. this.rankingData = result.resultlist.sort((a, b) => b.TOTALNUM - a.TOTALNUM).slice(0, 10)
  201. this.rankingDataComputed()
  202. this.rankInterval = setInterval(() => {
  203. this.currentHover = (this.currentHover + 1) % this.rankingData.length
  204. }, 1000)
  205. } else {
  206. throw new Error('Failed')
  207. }
  208. }).catch(error => {
  209. console.error('Error', error)
  210. return null
  211. })
  212. },
  213. rankingDataComputed() {
  214. const firstPlaceNum = this.rankingData[0].TOTALNUM
  215. this.rankingWithPercentage = this.rankingData.map(item => {
  216. if (item.RDNAME.length === 2) {
  217. // 截取name 字符串截取第一个字符,
  218. item.RDNAME = item.RDNAME.substring(0, 1) + ' * '
  219. } else if (item.RDNAME.length === 3) {
  220. // 截取第一个和第三个字符
  221. item.RDNAME = item.RDNAME.substring(0, 1) + ' * ' + item.RDNAME.substring(2, 3)
  222. } else if (item.RDNAME.length > 3) {
  223. // 截取第一个和大于第4个字符
  224. item.RDNAME = item.RDNAME.substring(0, 1) + ' * ' + ' * ' + item.RDNAME.substring(3, item.RDNAME.length)
  225. }
  226. const percentage = (item.TOTALNUM / firstPlaceNum) * 100
  227. return { ...item, percentage }
  228. })
  229. },
  230. getLendingTotal() {
  231. FetchLendingTotal().then(res => {
  232. const result = JSON.parse(res.data)
  233. if (result.success & result.resultlist.length !== 0) {
  234. // BZL_YEAR 本年办证人数
  235. this.cardTotal = result.resultlist.filter(item => item.LIBCODE === 'GD').reduce((acc, obj) => acc + obj.BZL_YEAR, 0)
  236. } else {
  237. this.cardTotal = 0
  238. }
  239. }).catch(error => {
  240. console.error('Error', error)
  241. })
  242. },
  243. // 馆藏量
  244. getLibBookTotal() {
  245. const params = {
  246. 'libcode': this.libcode,
  247. 'starttime': '2000-01-01',
  248. 'endtime': '2034-01-01'
  249. }
  250. // 先初始化馆藏量数据,避免后续找不到对应属性
  251. this.libALLNum = []
  252. FetchLibBookTotal(params)
  253. .then(res => {
  254. const result = JSON.parse(res.data)
  255. if (result.success && result.resultlist.length !== 0) {
  256. this.libALLNum = result.resultlist
  257. }
  258. return this.getUserTotal()
  259. })
  260. .then(userTotals => {
  261. console.log('userTotal', userTotals)
  262. if (Array.isArray(userTotals) && userTotals.length > 0) {
  263. userTotals.forEach(userTotal => {
  264. const libCode = Object.keys(userTotal)[0]
  265. const count = userTotal[libCode]
  266. const foundItem = this.libALLNum.find(item => item.LIBCODE === libCode)
  267. if (foundItem) {
  268. foundItem.countCard = count
  269. } else {
  270. this.libALLNum.push({
  271. LIBCODE: libCode,
  272. countCard: count
  273. })
  274. }
  275. })
  276. }
  277. // 执行后续逻辑
  278. this.getLibcodeDetails()
  279. })
  280. .catch(error => {
  281. console.error('Error', error)
  282. // 即使接口报错,也执行 getUserTotal 保证 countCard 有值
  283. this.getUserTotal()
  284. .then(userTotals => {
  285. console.log('userTotal (error case)', userTotals)
  286. if (Array.isArray(userTotals) && userTotals.length > 0) {
  287. userTotals.forEach(userTotal => {
  288. const libCode = Object.keys(userTotal)[0]
  289. const count = userTotal[libCode]
  290. this.libALLNum.push({
  291. LIBCODE: libCode,
  292. countCard: count
  293. })
  294. })
  295. }
  296. })
  297. .finally(() => {
  298. this.getLibcodeDetails()
  299. })
  300. })
  301. },
  302. // 左边办证量
  303. getTotalForLibcode(libcode) {
  304. const params = {
  305. 'libcode': libcode,
  306. 'startdate': '2000-01-01',
  307. 'enddate': '2034-01-01',
  308. 'isrdtype': 0
  309. }
  310. return FetchUsertotal(params).then(res => {
  311. const result = JSON.parse(res.data)
  312. if (result.success && result.pagedata.length > 0) {
  313. return { [libcode]: result.pagedata[0].count }
  314. } else {
  315. throw new Error('Failed' + libcode)
  316. }
  317. }).catch(error => {
  318. console.error('Error' + libcode, error)
  319. return { [libcode]: 0 }
  320. })
  321. },
  322. getUserTotal() {
  323. const libraries = ['GD']
  324. const getTotalPromises = libraries.map(libcode => this.getTotalForLibcode(libcode))
  325. return Promise.all(getTotalPromises)
  326. .then(results => {
  327. return results
  328. })
  329. .catch(error => {
  330. console.error('Error', error)
  331. return 0
  332. })
  333. },
  334. // 分管显示内容
  335. getLibcodeDetails() {
  336. FetchLibcodeDetails().then(res => {
  337. const result = JSON.parse(res.data)
  338. if (result.length !== 0) {
  339. const libCode = {
  340. 'DWSF': [114.664064, 30.478882],
  341. 'ZJWSF': [114.635376, 30.532215]
  342. }
  343. console.log('this.libALLNum', this.libALLNum)
  344. const nameToLibcodeMap = {
  345. '葛店城市书房·大湾分馆': 'DWSF',
  346. '葛店城市书房·张家湾分馆': 'ZJWSF'
  347. }
  348. const libcodeToGclMap = {
  349. 'DWSF': 9145, // 大湾分馆
  350. 'ZJWSF': 5582 // 张家湾分馆
  351. }
  352. // const allowedLibcodes = ['DWSF', 'ZJWSF']
  353. const updatedLibraries = result.map(library => {
  354. console.log('', library)
  355. // 通过图书馆名称获取对应的LIBCODE
  356. const currentLibcode = nameToLibcodeMap[library.name] || ''
  357. // 根据LIBCODE获取对应的GCL值
  358. const currentGcl = libcodeToGclMap[currentLibcode] || 10000
  359. // 保留原有的countCard逻辑
  360. const gdData = this.libALLNum.find(item => item.LIBCODE === 'GD')
  361. // 根据当前LIBCODE获取排序值
  362. const sortIndex = Object.keys(libCode).indexOf(currentLibcode)
  363. const sortValue = sortIndex > -1 ? sortIndex + 1 : 99
  364. return {
  365. ...library,
  366. GCL: currentGcl, // 按名称区分的GCL值
  367. // 直接使用result原始数据中的occupationArea,不再自定义覆盖
  368. sort: sortValue, // 按LIBCODE排序
  369. coordinate: libCode[currentLibcode] || [0, 0], // 匹配不到坐标时给默认值
  370. countCard: gdData?.countCard || 0
  371. }
  372. }).sort((a, b) => a.sort - b.sort)
  373. this.libInfoData = updatedLibraries
  374. console.log('this.libInfoData', this.libInfoData)
  375. if (localStorage.getItem('countItem')) {
  376. this.count = parseInt(localStorage.getItem('countItem'))
  377. } else {
  378. this.count = 0
  379. }
  380. if (this.libInfoData.length !== 0) {
  381. this.initChart() // 初始化
  382. setTimeout(() => {
  383. this.updateChart() // 更新数据,散点轮播显示
  384. this.startScrolling()
  385. window.addEventListener('resize', debounce(this.resize, 2000)) // 使用事件捕获,由外层向内
  386. }, 300)
  387. }
  388. } else {
  389. this.libInfoData = []
  390. }
  391. }).catch(error => {
  392. console.error('Error', error)
  393. })
  394. },
  395. initChart() {
  396. this.$echarts.registerMap('qiyang', mapJson) // 注册map
  397. this.myChart = this.$echarts.init(this.$refs.chart) // echarts容器实例化
  398. var mapImg = document.createElement('img')
  399. mapImg.style.height = mapImg.height = mapImg.width = mapImg.style.width = '1px'
  400. mapImg.src = require('../../assets/images/map-bg2.png')
  401. const colorMap = {
  402. '葛店城市书房·大湾分馆': '#FF7420', // 红色
  403. '葛店城市书房·张家湾分馆': '#4ECDC4' // 青色
  404. // '书房3': '#FFD166', // 黄色
  405. // '书房4': '#6A0572' // 紫色
  406. }
  407. var XAData = this.libInfoData.map(item => {
  408. const pointColor = colorMap[item.name] || '#FFFFFF' // 默认白色
  409. return [
  410. { name: '葛店城市书房·大湾分馆', color: pointColor },
  411. { name: item.name, value: item.address, color: pointColor }
  412. ]
  413. })
  414. var convertData = function(data) {
  415. var res = []
  416. for (var i = 0; i < data.length; i++) {
  417. var dataItem = data[i]
  418. var fromCoord = libJson[dataItem[0].name]
  419. var toCoord = libJson[dataItem[1].name]
  420. if (fromCoord && toCoord) {
  421. res.push({
  422. fromName: dataItem[0].name,
  423. toName: dataItem[1].name,
  424. coords: [fromCoord, toCoord],
  425. value: dataItem[1].value,
  426. color: dataItem[1].color // 传递颜色属性
  427. })
  428. }
  429. }
  430. return res
  431. }
  432. var series = [];
  433. [
  434. ['葛店城市书房·大湾分馆', XAData]
  435. ].forEach(function(item, i) {
  436. series.push(
  437. {
  438. name: item[0],
  439. type: 'effectScatter',
  440. // symbol: 'image://' + require('@/assets/images/map_10.png'),
  441. symbol: 'circle',
  442. symbolSize: [24, 14],
  443. coordinateSystem: 'geo',
  444. zlevel: 3,
  445. selectedMode: false,
  446. rippleEffect: {
  447. brushType: 'fill', // 填充模式
  448. color: 'rgba(255,255,255,0.4)',
  449. scale: 4, // 涟漪扩散大小(可调整)
  450. period: 4 // 动画周期
  451. },
  452. label: {
  453. normal: {
  454. show: true,
  455. position: 'right',
  456. formatter: ''
  457. }
  458. },
  459. itemStyle: {
  460. normal: {
  461. color: function(params) {
  462. console.log('点位名称:', params.name) // 现在能打印出值
  463. // 定义渐变生成函数,复用逻辑
  464. function createRadialGradient(centerColor, edgeColor) {
  465. // 创建径向渐变:x0, y0, r0, x1, y1, r1
  466. // (0.5,0.5)是中心点,0是中心半径,(0.5,0.5)是外圆中心,1是外圆半径
  467. return {
  468. type: 'radial',
  469. x: 0.5,
  470. y: 0.5,
  471. r: 1,
  472. colorStops: [{
  473. offset: 0, // 中心位置
  474. color: centerColor // 中心颜色
  475. }, {
  476. offset: 1, // 边缘位置
  477. color: edgeColor // 边缘颜色(可以浅一点或透明)
  478. }],
  479. global: false // 局部渐变,跟随元素
  480. }
  481. }
  482. switch (params.name) {
  483. case '葛店城市书房·大湾分馆':
  484. // 橙红渐变:中心深橙红,边缘浅橙红
  485. return createRadialGradient('#FF7420', '#FFB380')
  486. case '葛店城市书房·张家湾分馆':
  487. // 青蓝渐变:中心深青蓝,边缘浅青蓝
  488. return createRadialGradient('#4ECDC4', '#99E6E0')
  489. default:
  490. // 白色渐变:中心纯白,边缘浅灰(避免全白看不见)
  491. return createRadialGradient('#FFFFFF', '#F0F0F0')
  492. }
  493. },
  494. areaColor: 'transparent'
  495. },
  496. emphasis: {
  497. shadowColor: function(params) {
  498. switch (params.name) {
  499. case '葛店城市书房·大湾分馆':
  500. return '#FF7420'
  501. case '葛店城市书房·张家湾分馆':
  502. return '#4ECDC4'
  503. default:
  504. return '#FFFFFF'
  505. }
  506. }
  507. }
  508. },
  509. tooltip: {
  510. show: true
  511. },
  512. data: item[1].map(function(dataItem) {
  513. return {
  514. name: dataItem[1].name,
  515. value: dataItem[1].name ? libJson[dataItem[1].name].concat([dataItem[1].value]) : '',
  516. place: dataItem[1].value,
  517. color: dataItem[1].color
  518. }
  519. })
  520. },
  521. {
  522. name: item[0],
  523. type: 'lines',
  524. zlevel: 1,
  525. effect: {
  526. show: true,
  527. period: 6,
  528. trailLength: 0.7,
  529. color: function(params) {
  530. return params.data.color || 'red'
  531. },
  532. symbolSize: 3
  533. },
  534. lineStyle: {
  535. normal: {
  536. color: function(params) {
  537. return params.data.color || '#fff'
  538. },
  539. width: 0,
  540. curveness: 0.2
  541. }
  542. },
  543. tooltip: {
  544. show: false
  545. },
  546. data: convertData(item[1])
  547. },
  548. {
  549. name: item[0],
  550. type: 'lines',
  551. zlevel: 2,
  552. symbol: ['none', 'none'],
  553. symbolSize: 10,
  554. effect: {
  555. show: true,
  556. period: 6,
  557. trailLength: 0,
  558. symbol: 'arrow',
  559. symbolSize: 6
  560. },
  561. lineStyle: {
  562. normal: {
  563. color: function(params) {
  564. return params.data.color || '#fff'
  565. },
  566. width: 1,
  567. opacity: 0.6,
  568. curveness: 0.2
  569. }
  570. },
  571. tooltip: {
  572. show: false
  573. },
  574. data: convertData(item[1])
  575. }
  576. )
  577. })
  578. this.seriesData = series
  579. const initOption = {
  580. baseOption: {
  581. tooltip: {
  582. trigger: 'item',
  583. triggerOn: 'click',
  584. showContent: true,
  585. alwaysShowContent: true,
  586. enterable: 'mousemove|click',
  587. padding: [0, 0, 0, 0],
  588. backgroundColor: null,
  589. position: function(point, params, dom, rect, size) {
  590. return [point[0] + 14, point[1] - 164]
  591. },
  592. formatter: (params, ticket, callback) => {
  593. if (params.seriesType === 'effectScatter') {
  594. const pointColor = params.data.color || '#FF7420'
  595. const addressLine = params.data.place ? `<div class='place'>地址:${params.data.place}</div>` : ''
  596. // 动态设置边框颜色和背景渐变
  597. return `<div class='tooltip-main' >
  598. <div class='tooltip-line' style="background: linear-gradient(0deg, ${pointColor} 0%, rgba(255,255,255,0) 100%);"></div>
  599. <div class='tooltip-content' style="border-color: ${pointColor}; background-color: rgba(0,31,87,0.8);">
  600. <div class='title' style="background: linear-gradient(90deg, ${pointColor}, rgba(255,255,255,0.22));">${params.data.name}</div>
  601. ${addressLine}
  602. </div>
  603. </div>`
  604. } else if (params.seriesType === 'lines') {
  605. return (
  606. params.data.fromName +
  607. '>' +
  608. params.data.toName +
  609. '<br />' +
  610. params.data.value
  611. )
  612. } else {
  613. return params.name
  614. }
  615. }
  616. },
  617. // 设置geo坐标系
  618. geo: [
  619. {
  620. map: 'qiyang',
  621. aspectScale: 1,
  622. zoom: 0.96,
  623. top: '6%', // 距离顶部的位置,每层向下一个百分比
  624. left: '11%',
  625. roam: false, // 是否开启平游或缩放
  626. z: 6, // 可以看成是css的z-index,数字越大图层越高,我这里设置了5个,然后页面有点卡,根据实际需要来添加,3个其实就能看出效果了
  627. itemStyle: {
  628. areaColor: {
  629. type: 'linear',
  630. x: 0,
  631. y: 0,
  632. x2: 1,
  633. y2: 1,
  634. colorStops: [{
  635. offset: 0, color: 'rgba(0,0,0,.1)'
  636. }, {
  637. offset: 0.8, color: 'rgba(59,143,248,.6)'
  638. }],
  639. global: false
  640. },
  641. borderColor: '#9ffcff',
  642. borderWidth: 1
  643. },
  644. emphasis: {
  645. itemStyle: {
  646. areaColor: {
  647. type: 'linear',
  648. x: 0,
  649. y: 0,
  650. x2: 1,
  651. y2: 1,
  652. colorStops: [{
  653. offset: 0, color: 'rgba(0,0,0,.1)'
  654. }, {
  655. offset: 0.8, color: 'rgba(59,143,248,.6)'
  656. }],
  657. global: false
  658. } // 鼠标移上去时区域的颜色
  659. }
  660. },
  661. label: {
  662. emphasis: {
  663. show: false,
  664. color: '#fff'
  665. }
  666. },
  667. tooltip: {
  668. show: true
  669. }
  670. },
  671. {
  672. map: 'qiyang',
  673. aspectScale: 1,
  674. zoom: 0.96,
  675. top: '6%', // 距离顶部的位置,每层向下一个百分比
  676. left: '11%',
  677. roam: false, // 是否开启平游或缩放
  678. z: 5, // 可以看成是css的z-index,数字越大图层越高,我这里设置了5个,然后页面有点卡,根据实际需要来添加,3个其实就能看出效果了
  679. itemStyle: {
  680. areaColor: {
  681. type: 'pattern',
  682. image: mapImg,
  683. repeat: 'repeat'
  684. }, // 每个图层的背景色,根据需要来调,由亮变暗,下面的几个颜色也一样
  685. borderColor: '#9ffcff',
  686. borderWidth: 3,
  687. shadowColor: '#4cd4eb',
  688. shadowOffsetX: 0,
  689. shadowOffsetY: 0,
  690. shadowBlur: 0,
  691. emphasis: { // 地图悬停高亮样式
  692. areaColor: {
  693. type: 'pattern',
  694. image: mapImg,
  695. repeat: 'repeat'
  696. }
  697. }
  698. },
  699. emphasis: {
  700. disabled: true,
  701. areaColor: '#01215c'
  702. },
  703. label: {
  704. emphasis: {
  705. show: false,
  706. color: '#fff'
  707. }
  708. },
  709. tooltip: {
  710. show: false
  711. }
  712. },
  713. {
  714. map: 'qiyang',
  715. aspectScale: 1,
  716. zoom: 0.96,
  717. top: '7%', // 根据自己需要来设置
  718. left: '10%',
  719. roam: false, // 是否开启平游或缩放
  720. z: 4, // 变小,也就是被压在下面
  721. itemStyle: {
  722. areaColor: '#05498f', // 记得改颜色
  723. borderColor: '#0296cf',
  724. borderWidth: 2,
  725. shadowColor: '#0296cf',
  726. shadowOffsetX: 0,
  727. shadowOffsetY: 0,
  728. shadowBlur: 0,
  729. emphasis: { // 地图悬停高亮样式
  730. disabled: true,
  731. areaColor: '#05498f'
  732. }
  733. },
  734. tooltip: {
  735. show: false
  736. }
  737. },
  738. {
  739. map: 'qiyang',
  740. aspectScale: 1,
  741. zoom: 0.96,
  742. top: '9%', // 根据自己需要来设置
  743. left: '9%',
  744. roam: false,
  745. z: 3, // 变小,也就是被压在下面
  746. itemStyle: {
  747. areaColor: 'rgba(3,106,183,.5)', // 记得改颜色
  748. borderColor: '#025792',
  749. borderWidth: 2,
  750. shadowColor: '#025792',
  751. shadowOffsetX: 0,
  752. shadowOffsetY: 0,
  753. shadowBlur: 0,
  754. emphasis: { // 地图悬停高亮样式
  755. areaColor: 'rgba(3,106,183,.5)'
  756. }
  757. },
  758. tooltip: {
  759. show: false
  760. }
  761. },
  762. {
  763. map: 'qiyang',
  764. aspectScale: 1,
  765. zoom: 0.96,
  766. top: '11%', // 根据自己需要来设置
  767. left: '8%',
  768. roam: false,
  769. z: 2, // 变小,也就是被压在下面
  770. itemStyle: {
  771. areaColor: 'rgba(3,106,183,.2)', // 记得改颜色
  772. borderColor: '#195175',
  773. borderWidth: 1,
  774. shadowColor: '#0f4c74',
  775. shadowOffsetX: 0,
  776. shadowOffsetY: 4,
  777. shadowBlur: 10,
  778. emphasis: { // 地图悬停高亮样式
  779. areaColor: 'rgba(3,106,183,.2)'
  780. }
  781. },
  782. tooltip: {
  783. show: false
  784. }
  785. },
  786. {
  787. map: 'qiyang',
  788. aspectScale: 1,
  789. zoom: 0.96,
  790. top: '12%', // 根据自己需要来设置
  791. left: '10%',
  792. roam: false,
  793. z: 1, // 变小,也就是被压在下面
  794. itemStyle: {
  795. areaColor: 'rgba(0,0,0,.6)', // 记得改颜色
  796. borderColor: 'rgba(0,0,0,.6)',
  797. borderWidth: 2,
  798. shadowColor: 'rgba(0,0,0,.6)',
  799. shadowOffsetX: 0,
  800. shadowOffsetY: 4,
  801. shadowBlur: 10,
  802. emphasis: { // 地图悬停高亮样式
  803. areaColor: 'rgba(0,0,0,.6)'
  804. }
  805. },
  806. tooltip: {
  807. show: false
  808. }
  809. }
  810. ],
  811. series: series
  812. },
  813. media: [
  814. {
  815. query: {
  816. maxWidth: 666
  817. },
  818. option: {
  819. tooltip: {
  820. position: function(point, params, dom, rect, size) {
  821. return [point[0] + 10, point[1] - 122]
  822. }
  823. }
  824. }
  825. }
  826. ]
  827. }
  828. setTimeout(() => {
  829. this.myChart.setOption(initOption)
  830. }, 200)
  831. },
  832. // initChart() {
  833. // this.$echarts.registerMap('qiyang', mapJson) // 注册map
  834. // this.myChart = this.$echarts.init(this.$refs.chart) // echarts容器实例化
  835. // var mapImg = document.createElement('img')
  836. // mapImg.style.height = mapImg.height = mapImg.width = mapImg.style.width = '1px'
  837. // mapImg.src = require('../../assets/images/map-bg2.png')
  838. // var XAData = this.libInfoData.map(item => {
  839. // return [
  840. // { name: '葛店城市书房·大湾分馆' },
  841. // { name: item.name, value: item.address }
  842. // ]
  843. // })
  844. // var convertData = function(data) {
  845. // var res = []
  846. // for (var i = 0; i < data.length; i++) {
  847. // var dataItem = data[i]
  848. // var fromCoord = libJson[dataItem[0].name]
  849. // var toCoord = libJson[dataItem[1].name]
  850. // if (fromCoord && toCoord) {
  851. // res.push({
  852. // fromName: dataItem[0].name,
  853. // toName: dataItem[1].name,
  854. // coords: [fromCoord, toCoord],
  855. // value: dataItem[1].value
  856. // })
  857. // }
  858. // }
  859. // return res
  860. // }
  861. // var series = [];
  862. // [
  863. // ['葛店城市书房·大湾分馆', XAData]
  864. // ].forEach(function(item, i) {
  865. // series.push(
  866. // {
  867. // name: item[0],
  868. // type: 'effectScatter',
  869. // symbol: 'image://' + require('@/assets/images/map_10.png'),
  870. // symbolSize: [26, 20],
  871. // coordinateSystem: 'geo',
  872. // zlevel: 3,
  873. // selectedMode: false,
  874. // rippleEffect: {
  875. // // brushType: 'stroke',
  876. // color: 'transparent'
  877. // // scale: 1.5
  878. // },
  879. // label: {
  880. // normal: {
  881. // show: true,
  882. // position: 'right',
  883. // formatter: ''
  884. // }
  885. // },
  886. // itemStyle: {
  887. // normal: {
  888. // color: 'transparent',
  889. // areaColor: 'transparent'
  890. // },
  891. // emphasis: {
  892. // areaColor: '#2B91B7'
  893. // }
  894. // },
  895. // tooltip: {
  896. // show: true
  897. // },
  898. // data: item[1].map(function(dataItem) {
  899. // return {
  900. // name: dataItem[1].name,
  901. // value: dataItem[1].name ? libJson[dataItem[1].name].concat([dataItem[1].value]) : '',
  902. // place: dataItem[1].value
  903. // }
  904. // })
  905. // },
  906. // {
  907. // name: item[0],
  908. // type: 'lines',
  909. // zlevel: 1,
  910. // effect: {
  911. // show: true,
  912. // period: 6,
  913. // trailLength: 0.7,
  914. // color: 'red', // arrow箭头的颜色
  915. // symbolSize: 3
  916. // },
  917. // lineStyle: {
  918. // normal: {
  919. // color: '#fff',
  920. // width: 0,
  921. // curveness: 0.2
  922. // }
  923. // },
  924. // tooltip: {
  925. // show: false
  926. // },
  927. // data: convertData(item[1])
  928. // },
  929. // {
  930. // name: item[0],
  931. // type: 'lines',
  932. // zlevel: 2,
  933. // symbol: ['none', 'arrow'],
  934. // symbolSize: 10, // 固定箭头大小
  935. // effect: {
  936. // show: true,
  937. // period: 6,
  938. // trailLength: 0,
  939. // symbol: 'arrow',
  940. // symbolSize: 10 // 动态箭头大小
  941. // },
  942. // lineStyle: {
  943. // normal: {
  944. // color: '#fff',
  945. // width: 1,
  946. // opacity: 0.6,
  947. // curveness: 0.2
  948. // }
  949. // },
  950. // tooltip: {
  951. // show: false
  952. // },
  953. // data: convertData(item[1])
  954. // }
  955. // )
  956. // })
  957. // this.seriesData = series
  958. // const initOption = {
  959. // baseOption: {
  960. // // 提示框
  961. // tooltip: {
  962. // trigger: 'item',
  963. // triggerOn: 'click',
  964. // showContent: true, // 是否显示提示框浮层
  965. // alwaysShowContent: true, // 是否一直显示提示框内容
  966. // // hideDelay: 100, // 浮层隐藏的延迟
  967. // enterable: 'mousemove|click',
  968. // padding: [0, 0, 0, 0],
  969. // backgroundColor: null,
  970. // position: function(point, params, dom, rect, size) {
  971. // return [point[0] + 14, point[1] - 164]
  972. // },
  973. // formatter: (params, ticket, callback) => {
  974. // if (params.seriesType === 'effectScatter') {
  975. // const addressLine = params.data.place ? `<div class='place'>地址:${params.data.place}</div>` : ''
  976. // return `<div class='tooltip-main' >
  977. // <div class='tooltip-line'></div>
  978. // <div class='tooltip-content'>
  979. // <div class='title'>${params.data.name}</div>
  980. // ${addressLine}
  981. // </div>
  982. // </div>`
  983. // } else if (params.seriesType === 'lines') {
  984. // return (
  985. // params.data.fromName +
  986. // '>' +
  987. // params.data.toName +
  988. // '<br />' +
  989. // params.data.value
  990. // )
  991. // } else {
  992. // return params.name
  993. // }
  994. // }
  995. // },
  996. // // 设置geo坐标系
  997. // geo: [
  998. // {
  999. // map: 'qiyang',
  1000. // aspectScale: 1,
  1001. // zoom: 1,
  1002. // top: '6%', // 距离顶部的位置,每层向下一个百分比
  1003. // left: '11%',
  1004. // roam: false, // 是否开启平游或缩放
  1005. // z: 6, // 可以看成是css的z-index,数字越大图层越高,我这里设置了5个,然后页面有点卡,根据实际需要来添加,3个其实就能看出效果了
  1006. // itemStyle: {
  1007. // areaColor: {
  1008. // type: 'linear',
  1009. // x: 0,
  1010. // y: 0,
  1011. // x2: 1,
  1012. // y2: 1,
  1013. // colorStops: [{
  1014. // offset: 0, color: 'rgba(0,0,0,.1)'
  1015. // }, {
  1016. // offset: 0.8, color: 'rgba(59,143,248,.6)'
  1017. // }],
  1018. // global: false
  1019. // },
  1020. // borderColor: '#9ffcff',
  1021. // borderWidth: 1
  1022. // },
  1023. // emphasis: {
  1024. // itemStyle: {
  1025. // areaColor: {
  1026. // type: 'linear',
  1027. // x: 0,
  1028. // y: 0,
  1029. // x2: 1,
  1030. // y2: 1,
  1031. // colorStops: [{
  1032. // offset: 0, color: 'rgba(0,0,0,.1)'
  1033. // }, {
  1034. // offset: 0.8, color: 'rgba(59,143,248,.6)'
  1035. // }],
  1036. // global: false
  1037. // } // 鼠标移上去时区域的颜色
  1038. // }
  1039. // },
  1040. // label: {
  1041. // emphasis: {
  1042. // show: false,
  1043. // color: '#fff'
  1044. // }
  1045. // },
  1046. // tooltip: {
  1047. // show: true
  1048. // }
  1049. // },
  1050. // {
  1051. // map: 'qiyang',
  1052. // aspectScale: 1,
  1053. // zoom: 1,
  1054. // top: '6%', // 距离顶部的位置,每层向下一个百分比
  1055. // left: '11%',
  1056. // roam: false, // 是否开启平游或缩放
  1057. // z: 5, // 可以看成是css的z-index,数字越大图层越高,我这里设置了5个,然后页面有点卡,根据实际需要来添加,3个其实就能看出效果了
  1058. // itemStyle: {
  1059. // areaColor: {
  1060. // type: 'pattern',
  1061. // image: mapImg,
  1062. // repeat: 'repeat'
  1063. // }, // 每个图层的背景色,根据需要来调,由亮变暗,下面的几个颜色也一样
  1064. // borderColor: '#9ffcff',
  1065. // borderWidth: 3,
  1066. // shadowColor: '#4cd4eb',
  1067. // shadowOffsetX: 0,
  1068. // shadowOffsetY: 0,
  1069. // shadowBlur: 0,
  1070. // emphasis: { // 地图悬停高亮样式
  1071. // areaColor: {
  1072. // type: 'pattern',
  1073. // image: mapImg,
  1074. // repeat: 'repeat'
  1075. // }
  1076. // }
  1077. // },
  1078. // emphasis: {
  1079. // disabled: true,
  1080. // areaColor: '#01215c'
  1081. // },
  1082. // label: {
  1083. // emphasis: {
  1084. // show: false,
  1085. // color: '#fff'
  1086. // }
  1087. // },
  1088. // tooltip: {
  1089. // show: false
  1090. // }
  1091. // },
  1092. // {
  1093. // map: 'qiyang',
  1094. // aspectScale: 1,
  1095. // zoom: 1,
  1096. // top: '7%', // 根据自己需要来设置
  1097. // left: '10%',
  1098. // roam: false, // 是否开启平游或缩放
  1099. // z: 4, // 变小,也就是被压在下面
  1100. // itemStyle: {
  1101. // areaColor: '#05498f', // 记得改颜色
  1102. // borderColor: '#0296cf',
  1103. // borderWidth: 2,
  1104. // shadowColor: '#0296cf',
  1105. // shadowOffsetX: 0,
  1106. // shadowOffsetY: 0,
  1107. // shadowBlur: 0,
  1108. // emphasis: { // 地图悬停高亮样式
  1109. // disabled: true,
  1110. // areaColor: '#05498f'
  1111. // }
  1112. // },
  1113. // tooltip: {
  1114. // show: false
  1115. // }
  1116. // },
  1117. // {
  1118. // map: 'qiyang',
  1119. // aspectScale: 1,
  1120. // zoom: 1,
  1121. // top: '9%', // 根据自己需要来设置
  1122. // left: '9%',
  1123. // roam: false,
  1124. // z: 3, // 变小,也就是被压在下面
  1125. // itemStyle: {
  1126. // areaColor: 'rgba(3,106,183,.5)', // 记得改颜色
  1127. // borderColor: '#025792',
  1128. // borderWidth: 2,
  1129. // shadowColor: '#025792',
  1130. // shadowOffsetX: 0,
  1131. // shadowOffsetY: 0,
  1132. // shadowBlur: 0,
  1133. // emphasis: { // 地图悬停高亮样式
  1134. // areaColor: 'rgba(3,106,183,.5)'
  1135. // }
  1136. // },
  1137. // tooltip: {
  1138. // show: false
  1139. // }
  1140. // },
  1141. // {
  1142. // map: 'qiyang',
  1143. // aspectScale: 1,
  1144. // zoom: 1,
  1145. // top: '11%', // 根据自己需要来设置
  1146. // left: '8%',
  1147. // roam: false,
  1148. // z: 2, // 变小,也就是被压在下面
  1149. // itemStyle: {
  1150. // areaColor: 'rgba(3,106,183,.2)', // 记得改颜色
  1151. // borderColor: '#195175',
  1152. // borderWidth: 1,
  1153. // shadowColor: '#0f4c74',
  1154. // shadowOffsetX: 0,
  1155. // shadowOffsetY: 4,
  1156. // shadowBlur: 10,
  1157. // emphasis: { // 地图悬停高亮样式
  1158. // areaColor: 'rgba(3,106,183,.2)'
  1159. // }
  1160. // },
  1161. // tooltip: {
  1162. // show: false
  1163. // }
  1164. // },
  1165. // {
  1166. // map: 'qiyang',
  1167. // aspectScale: 1,
  1168. // zoom: 1,
  1169. // top: '12%', // 根据自己需要来设置
  1170. // left: '10%',
  1171. // roam: false,
  1172. // z: 1, // 变小,也就是被压在下面
  1173. // itemStyle: {
  1174. // areaColor: 'rgba(0,0,0,.6)', // 记得改颜色
  1175. // borderColor: 'rgba(0,0,0,.6)',
  1176. // borderWidth: 2,
  1177. // shadowColor: 'rgba(0,0,0,.6)',
  1178. // shadowOffsetX: 0,
  1179. // shadowOffsetY: 4,
  1180. // shadowBlur: 10,
  1181. // emphasis: { // 地图悬停高亮样式
  1182. // areaColor: 'rgba(0,0,0,.6)'
  1183. // }
  1184. // },
  1185. // tooltip: {
  1186. // show: false
  1187. // }
  1188. // }
  1189. // ],
  1190. // series: series
  1191. // },
  1192. // media: [
  1193. // {
  1194. // query: {
  1195. // maxWidth: 666
  1196. // },
  1197. // option: {
  1198. // tooltip: {
  1199. // position: function(point, params, dom, rect, size) {
  1200. // return [point[0] + 10, point[1] - 122]
  1201. // }
  1202. // }
  1203. // }
  1204. // }
  1205. // ]
  1206. // }
  1207. // setTimeout(() => {
  1208. // this.myChart.setOption(initOption)
  1209. // }, 200)
  1210. // },
  1211. updateChart() {
  1212. // 地图数据
  1213. // const mapData = mapJson.features.map((item) => {
  1214. // return {
  1215. // name: item.properties.name,
  1216. // value: Math.round(Math.random() * 100),
  1217. // centroid: item.properties.centroid,
  1218. // adcode: item.properties.adcode
  1219. // }
  1220. // })
  1221. // 散点数据
  1222. // const scatterData = libJsonData
  1223. // const scatterData = mapData.map((item) => {
  1224. // return {
  1225. // name: item.name,
  1226. // value: item.centroid
  1227. // ? item.centroid.concat(item.value)
  1228. // : item.centroid, // [经, 纬度, 值]
  1229. // itemStyle: {
  1230. // color: 'red'
  1231. // }
  1232. // // adcode: item.adcode,
  1233. // }
  1234. // })
  1235. // const updateOption = {
  1236. // series: [
  1237. // {
  1238. // data: mapData // type: 'map'
  1239. // },
  1240. // {
  1241. // data: mapData // type: 'map'
  1242. // },
  1243. // {
  1244. // data: scatterData // type: 'effectScatter'
  1245. // }
  1246. // ]
  1247. // }
  1248. this.len = this.seriesData[0].data.length // 此处设置的是需要轮播的次数
  1249. // this.myChart.setOption(updateOption)
  1250. this.libIndex = this.count % this.len
  1251. this.libCurrent = this.libInfoData[this.libIndex]
  1252. console.log('this.libIndex', this.libIndex)
  1253. console.log('this.libCurrent22', this.libCurrent)
  1254. this.initSwiper()
  1255. this.updatePageWithData()
  1256. this.autohover()
  1257. },
  1258. mouseMove() {
  1259. // 当鼠标移入,终止轮播,高亮显示当前区域
  1260. this.myChart.on('mouseover', (params) => {
  1261. clearInterval(this.timeTicket)
  1262. this.myChart.dispatchAction({
  1263. type: 'downplay'
  1264. // seriesIndex: 0
  1265. })
  1266. this.myChart.dispatchAction({
  1267. type: 'highlight',
  1268. seriesIndex: 0,
  1269. dataIndex: params.dataIndex
  1270. })
  1271. this.myChart.dispatchAction({
  1272. type: 'showTip',
  1273. seriesIndex: 0,
  1274. dataIndex: params.dataIndex
  1275. })
  1276. })
  1277. // 当鼠标移出,轮播继续开始
  1278. this.myChart.on('mouseout', this.autohover)
  1279. },
  1280. autohover() {
  1281. // clearInterval(this.timeTicket)
  1282. // this.timeTicket = setInterval(() => {
  1283. // 1. 取消上次的高亮
  1284. this.myChart.dispatchAction({
  1285. type: 'downplay',
  1286. seriesIndex: 0
  1287. })
  1288. // 2. 显示当前高亮
  1289. this.myChart.dispatchAction({
  1290. type: 'highlight',
  1291. seriesIndex: 0,
  1292. dataIndex: this.count % this.len
  1293. })
  1294. // 3. 显示提示框中的信息
  1295. this.myChart.dispatchAction({
  1296. type: 'showTip',
  1297. seriesIndex: 0,
  1298. dataIndex: this.count % this.len
  1299. })
  1300. // }, 2000)
  1301. },
  1302. resize() {
  1303. this.myChart.resize()
  1304. },
  1305. updatePageWithData() {
  1306. this.displayedImages = []
  1307. const linkSrc = process.env.NODE_ENV === 'production' ? window.g.ApiUrl : process.env.VUE_APP_BASE_API
  1308. const params = {
  1309. 'branchId': this.libCurrent.id
  1310. }
  1311. FetchLibcodeResouceDetails(params).then(res => {
  1312. const result = JSON.parse(res.data)
  1313. this.displayedImages = result.map((item, index) => {
  1314. if (item.filePath) {
  1315. item.cover = linkSrc + '/downloadFile' + item.filePath
  1316. } else {
  1317. item.cover = ''
  1318. }
  1319. return item
  1320. })
  1321. this.currentIndex = 0
  1322. this.swiperKey += 1
  1323. if (this.displayedImages.length === 1) {
  1324. setTimeout(() => {
  1325. this.count++
  1326. this.libIndex = this.count % this.len
  1327. this.libCurrent = this.libInfoData[this.libIndex]
  1328. this.updatePageWithData()
  1329. this.autohover()
  1330. }, 5000)
  1331. }
  1332. }).catch(error => {
  1333. console.error('Error', error)
  1334. })
  1335. },
  1336. initSwiper() {
  1337. const _self = this
  1338. this.swiperOption = {
  1339. // loop: true,
  1340. // initialSlide: 0,
  1341. notNextTick: false, // notNextTick是一个组件自有属性,如果notNextTick设置为true,组件则不会通过NextTick来实例化swiper,也就意味着你可以在第一时间获取到swiper对象,假如你需要刚加载遍使用获取swiper对象来做什么事,那么这个属性一定要是true
  1342. // slidesPerView: 3, // 数量
  1343. // spaceBetween: 30, // 间距
  1344. // slidesPerGroup: 1, // 分几组
  1345. // 禁止滑动
  1346. noSwiping: true,
  1347. observer: true, // 开启动态检查器
  1348. direction: 'horizontal', // 设置水平还是垂直vertical
  1349. // grabCursor: true, //光标样式
  1350. // setWrapperSize: true,
  1351. // autoHeight: true,
  1352. // centeredSlides: true,
  1353. // paginationClickable: true,
  1354. // keyboard: true, //键盘控制
  1355. // mousewheelControl: true, //鼠标轮控制
  1356. autoplay: {
  1357. delay: 3000, // 自动切换的时间间隔,单位ms
  1358. stopOnLastSlide: false, // 当切换到最后一个slide时停止自动切换
  1359. disableOnInteraction: false // 用户操作swiper之后,是否禁止autoplay
  1360. // reverseDirection: false, //开启反向自动轮播
  1361. // waitForTransition: true, //等待过渡完毕。自动切换会在slide过渡完毕后才开始计时
  1362. },
  1363. // 显示分页
  1364. pagination: {
  1365. el: '.swiper-pagination',
  1366. type: 'progressbar'
  1367. // progressbarOpposite: true,
  1368. // clickable: true // 允许分页点击跳转
  1369. },
  1370. on: {
  1371. slideChangeTransitionEnd() {
  1372. _self.currentIndex = this.activeIndex
  1373. if (_self.currentIndex === _self.displayedImages.length - 1) {
  1374. setTimeout(() => {
  1375. if (_self.count === _self.libInfoData.length - 1) {
  1376. _self.count = 0
  1377. // _self.$parent.autoPagination(3)
  1378. } else {
  1379. _self.count++
  1380. }
  1381. _self.libIndex = _self.count % _self.len
  1382. _self.libCurrent = _self.libInfoData[_self.libIndex]
  1383. console.log('_self.count', _self.count)
  1384. console.log('_self.libIndex', _self.libIndex)
  1385. console.log('_self.libCurrent', _self.libCurrent)
  1386. _self.updatePageWithData()
  1387. _self.autohover()
  1388. _self.startScrolling()
  1389. _self.currentIndex = 0
  1390. }, 3000)
  1391. }
  1392. }
  1393. }
  1394. }
  1395. }
  1396. }
  1397. }
  1398. </script>
  1399. <style lang="scss">
  1400. @import "~@/assets/styles/index.scss";
  1401. </style>
  1402. <!--
  1403. {
  1404. type: 'map',
  1405. map: 'qiyang',
  1406. roam: false,
  1407. silent: true,
  1408. // geoIndex: 0, geoIndex 指定一个 geo 组件。这样的话,map 和 其他 series(例如散点图)就可以共享一个 geo 组件了。
  1409. data: null,
  1410. label: {
  1411. show: false,
  1412. fontSize: 0
  1413. }
  1414. },
  1415. {
  1416. name: item[0] + ' Top3',
  1417. type: 'lines',
  1418. zlevel: 1,
  1419. effect: {
  1420. show: true,
  1421. period: 6,
  1422. trailLength: 0.7,
  1423. color: 'red', // arrow箭头的颜色
  1424. symbolSize: 3
  1425. },
  1426. lineStyle: {
  1427. normal: {
  1428. color: color[i],
  1429. width: 0,
  1430. curveness: 0.2
  1431. }
  1432. },
  1433. data: convertData(item[1])
  1434. },
  1435. {
  1436. type: 'effectScatter',
  1437. coordinateSystem: 'geo', // 注意坐标系的设置
  1438. // symbol: 'image://' + require('../../assets/images/default-img.png'),
  1439. data: null,
  1440. symbolSize: [8, 4],
  1441. showEffectOn: 'render',
  1442. rippleEffect: {
  1443. brushType: 'stroke',
  1444. color: '#9ffcff',
  1445. period: 9,
  1446. scale: 5
  1447. },
  1448. label: {
  1449. show: true,
  1450. color: '#FFF',
  1451. formatter: '',
  1452. offset: [0, -12]
  1453. },
  1454. emphasis: {
  1455. // 设置高亮显示的状态
  1456. scale: 8,
  1457. itemStyle: {
  1458. color: 'pink'
  1459. }
  1460. }
  1461. } -->