江夏区图书馆自助查询机
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.

145 lines
4.3 KiB

6 months ago
6 months ago
6 months ago
  1. <template>
  2. <div class="ranking">
  3. <h4 class="filter-header">热门书架</h4>
  4. <ul class="ranking-list-bottom shelf-list">
  5. <li v-for="(item,index) in shelfHot" :key="index" @click="handleShelfPosition(item)">
  6. <span>{{ 'TOP'+ (index+1) }}</span>
  7. <p class="title-item-only place-detail">{{ removeAreaPrefix(item.grid_name) }}</p>
  8. </li>
  9. </ul>
  10. <el-dialog class="positionDialog" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseDialog" :visible="positionVisible" :title="positionTitle">
  11. <div class="setting-dialog">
  12. <ul class="book-detail">
  13. <li><span>所属楼层</span>{{ positionContent.floorName }}</li>
  14. <li><span>所属区域</span>{{ positionContent.regionName }}</li>
  15. <li><span>所属书架</span>{{ positionContent.gridName }}</li>
  16. </ul>
  17. <div class="position-content">
  18. <div class="position-left">
  19. <h5>平面图</h5>
  20. <div class="venue-preview">
  21. <div v-show="currentMarkData && currentMarkData.signPoint ">
  22. <canvas :id="`canvasPreview${currentMarkData && currentMarkData.id}hot`" :width="width" :height="height" />
  23. </div>
  24. <img v-if="currentMarkData && !currentMarkData.signPoint" :src="imageUrl" :onerror="defaultImg" alt="">
  25. <img v-if="!currentMarkData" :src="imageUrl" :onerror="defaultImg" alt="">
  26. </div>
  27. </div>
  28. <div class="position-right">
  29. <h5>书架图</h5>
  30. <div class="shelf-top" :style="rowStyle">
  31. <p v-for="(item,index) in reversedRackNum" :key="index" :style="{width: `calc(${'100%/' + rackNum} - 4px )`}"><span>{{ item + '架' }}</span></p>
  32. </div>
  33. <ul class="data-shelf-row" :style="rowStyle">
  34. <li
  35. v-for="(cell,i) in booShelfGrid"
  36. :key="i"
  37. :class="{ active: i === cellIndex }"
  38. class="data-shelf-cell"
  39. :style="cellStyle"
  40. >
  41. <span class="cell-name">{{ removeLayerPrefix(cell.gridName) }}</span>
  42. </li>
  43. </ul>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="book-bottom" @click="handleCloseDialog">
  48. <span>关闭</span>
  49. </div>
  50. </el-dialog>
  51. </div>
  52. </template>
  53. <script>
  54. import { FetchInitHotShelfList } from '@/api/inquiryMachine'
  55. import { positionCrud } from '../mixins/index.js'
  56. export default {
  57. name: 'Ranking',
  58. components: {
  59. },
  60. mixins: [positionCrud],
  61. props: {
  62. },
  63. data() {
  64. return {
  65. defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
  66. shelfHot: []
  67. }
  68. },
  69. computed: {
  70. },
  71. created() {
  72. this.getInitHotShelfList()
  73. },
  74. mounted() {
  75. },
  76. methods: {
  77. removeLayerPrefix(gridNames) {
  78. const index = gridNames.indexOf('面')
  79. if (index !== -1) {
  80. return gridNames.substring(index + 1)
  81. }
  82. return gridNames
  83. },
  84. handleShelfPosition(item) {
  85. this.positionContent = {
  86. 'floorName': item.floorName,
  87. 'regionName': item.regionName,
  88. 'gridName': item.grid_name
  89. }
  90. this.handlePosition(item, 'hot')
  91. },
  92. removeAreaPrefix(gridNames) {
  93. const index = gridNames.indexOf('区')
  94. if (index !== -1) {
  95. return gridNames.substring(index + 1)
  96. }
  97. return gridNames
  98. },
  99. getInitHotShelfList() {
  100. const params = {
  101. 'fondsCode': this.libcode,
  102. 'size': 5
  103. }
  104. FetchInitHotShelfList(params).then(res => {
  105. this.shelfHot = res
  106. }).catch(() => {
  107. this.$message.error('接口错误')
  108. })
  109. }
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. @import "~@/assets/styles/index.scss";
  115. .shelf-list{
  116. height: 434px;
  117. }
  118. ::v-deep .el-dialog{
  119. width: 930px;
  120. border-radius: 16px;
  121. background: #F8F8FD;
  122. box-shadow: 0px 3px 20px 1px rgba(0,0,0,0.05);
  123. .el-dialog__body{
  124. padding: 20px 0 23px 0;
  125. }
  126. }
  127. ::v-deep .el-dialog__headerbtn{
  128. display: none;
  129. }
  130. ::v-deep .el-dialog__title{
  131. font-weight: bold;
  132. }
  133. ::v-deep .el-dialog__header{
  134. border-bottom: 1px solid #EDEFF3;
  135. }
  136. .place-detail{
  137. padding-right: 46px;
  138. background-size: 29px 30px;
  139. }
  140. </style>