图书馆综合管理系统
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.

279 lines
9.9 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <div class="app-container">
  3. <div class="venue-header">
  4. <h4><i class="iconfont icon-shuju" />数据总览</h4>
  5. <p><i class="iconfont icon-gongsi" />{{ user.fonds.fondsName }}</p>
  6. </div>
  7. <div class="venue-content dataScreening-content">
  8. <crudOperation :permission="permission">
  9. <template v-slot:middle>
  10. <el-button v-permission="permission.add" class="check-btn" size="mini" @click="toAdd(1)">
  11. <i class="iconfont icon-shengchengpandiandan" />
  12. 全量盘点
  13. </el-button>
  14. </template>
  15. <template v-slot:right>
  16. <el-button :loading="crud.downloadLoading" size="mini" @click="doExport(crud.selections)">
  17. <i class="iconfont icon-daochu" />
  18. 导出
  19. </el-button>
  20. </template>
  21. </crudOperation>
  22. <div class="venue-left">
  23. <div class="container-right tab-content">
  24. <span class="right-top-line" />
  25. <span class="left-bottom-line" />
  26. <ul class="tab-nav">
  27. <li v-for="(item,index) in floorOptions" :key="index" :class="{ 'active-tab-nav': tabIndex == index }" @click="changeActiveTab(index)">{{ item.floorName }}<i /></li>
  28. <!-- 最右侧装饰img -->
  29. <span class="tab-right-img" />
  30. </ul>
  31. <div class="total-data">
  32. <span>楼层概况</span>
  33. <p>区域1</p>
  34. <p>书架4</p>
  35. <p>摄像头12</p>
  36. </div>
  37. <CanvasPreview ref="previewRefs" v-loading="prewLoading" page-preview="floor" :current-mark-data="currentMarkData" :image-url="imageUrl" />
  38. </div>
  39. </div>
  40. <div class="venue-right">
  41. <div class="lib-right-item lib-info">
  42. <h4>场馆概况</h4>
  43. <ul class="data-right-list">
  44. <li><p>楼层</p><span><i>5</i></span></li>
  45. <li><p>区域</p><span><i>25</i></span></li>
  46. <li><p>书架</p><span><i>100</i></span></li>
  47. <li><p>摄像头</p><span><i>300</i></span></li>
  48. </ul>
  49. </div>
  50. <div class="lib-right-item">
  51. <h4>盘点概况</h4>
  52. <div class="refresh-date">2024-11-28 09:46</div>
  53. <ul class="data-right-list">
  54. <li><p>在架</p><span><i>15000</i></span></li>
  55. <li><p>错架</p><span><i>300</i></span> <span class="percentage">2.00%</span></li>
  56. <li><p>错序</p><span><i>0</i></span><span class="percentage">0.00%</span></li>
  57. </ul>
  58. </div>
  59. <div class="lib-right-item">
  60. <h4>流通统计</h4>
  61. <div class="refresh-date">2024-11-28 09:46</div>
  62. <bookSwiper />
  63. </div>
  64. </div>
  65. </div>
  66. <!-- form -->
  67. <!-- <el-dialog append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title">
  68. <span class="dialog-right-top" />
  69. <span class="dialog-left-bottom" />
  70. <div class="setting-dialog">
  71. <el-form ref="form" :inline="true" :model="form" :rules="rules" size="small" label-width="80px">
  72. <el-form-item label="盘点单号" prop="stockBill">
  73. <el-input v-model="form.stockBill" disabled />
  74. </el-form-item>
  75. <el-form-item label="盘点类型" prop="stockTypeName">
  76. <el-input v-model="form.stockTypeName" disabled />
  77. </el-form-item>
  78. <el-form-item label="目标位置" prop="stockRegion">
  79. <el-input v-model="form.stockRegion" disabled />
  80. </el-form-item>
  81. <el-form-item label="目标数量" prop="stockGridNumName">
  82. <el-input v-model="form.stockGridNumName" disabled />
  83. </el-form-item>
  84. <el-row>
  85. <el-form-item label="备注" prop="stockRemarks">
  86. <el-input v-model="form.stockRemarks" type="textarea" style="width: 572px;" :rows="4" />
  87. </el-form-item>
  88. </el-row>
  89. </el-form>
  90. <div slot="footer" class="dialog-footer">
  91. <el-button type="text" @click="crud.cancelCU">取消</el-button>
  92. <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">保存</el-button>
  93. </div>
  94. </div>
  95. </el-dialog> -->
  96. <!-- @refresh="initData" -->
  97. <eForm ref="eform" />
  98. </div>
  99. </template>
  100. <script>
  101. import { FetchInitLibraryRegionList } from '@/api/area/index'
  102. import crudStockTaskLog from '@/api/stockTaskLog/index'
  103. // import crudFloor from '@/api/floor/index'
  104. import CRUD, { presenter, header, crud } from '@crud/crud'
  105. import crudOperation from '@crud/CRUD.operation'
  106. import { mapGetters } from 'vuex'
  107. import defaultImg from '@/assets/images/system/default-img.jpg'
  108. import bookSwiper from '@/views/components/bookSwiper.vue'
  109. import CanvasPreview from '@/views/components/canvasPreview.vue'
  110. import eForm from './module/form'
  111. export default {
  112. name: 'DataScreening',
  113. components: { crudOperation, bookSwiper, CanvasPreview, eForm },
  114. cruds() {
  115. return CRUD({ title: '数据总览', url: 'api/libraryFloor/initLibraryFloorList', crudMethod: { ...crudStockTaskLog }, sort: [], optShow: {
  116. add: false,
  117. edit: false,
  118. del: false,
  119. download: false,
  120. group: false,
  121. reset: false
  122. }})
  123. },
  124. mixins: [presenter(), header(), crud()],
  125. data() {
  126. const _this = this
  127. return {
  128. prewLoading: false,
  129. floorOptions: [],
  130. tabIndex: 0,
  131. defaultImg: defaultImg,
  132. imageUrl: defaultImg,
  133. imageRegionUrl: defaultImg,
  134. currentMarkData: null,
  135. allCoverData: [],
  136. swiperActiveIndex: 0,
  137. rightDataIndex: null,
  138. swiperOptionContent: {
  139. slidesPerView: 'auto',
  140. on: {
  141. slideChangeTransitionStart: function() {
  142. _this.rightDataIndex = null
  143. _this.swiperActiveIndex = this.activeIndex
  144. _this.swiperTitle.slideTo(this.activeIndex, 500, false)
  145. }
  146. }
  147. },
  148. swiperOptionTitle: {
  149. slidesPerView: 'auto',
  150. freeMode: true
  151. },
  152. tabListData: [{ name: '热门图书' }, { name: '热门架位' }, { name: '冷面图书' }],
  153. permission: {
  154. add: ['admin', 'floor:add'],
  155. edit: ['admin', 'floor:edit'],
  156. del: ['admin', 'floor:del']
  157. }
  158. }
  159. },
  160. computed: {
  161. ...mapGetters([
  162. 'user',
  163. 'baseApi'
  164. ]),
  165. swiperContent() {
  166. return this.$refs.swiperContent.$el.swiper
  167. }
  168. },
  169. methods: {
  170. [CRUD.HOOK.beforeRefresh]() {
  171. },
  172. [CRUD.HOOK.afterRefresh](crud) {
  173. this.floorOptions = crud.data
  174. if (this.$route.query.floorTabIndex) {
  175. this.tabIndex = this.$route.query.floorTabIndex
  176. } else {
  177. this.tabIndex = 0
  178. }
  179. this.changeActiveTab(this.tabIndex)
  180. },
  181. // // 新增前
  182. // [CRUD.HOOK.beforeToAdd]() {
  183. // if (this.crud.form.stockType === 1) {
  184. // this.crud.form.stockTypeName = '全量盘点'
  185. // }
  186. // Promise.all([
  187. // crudStockTaskLog.FetchNewBillNo(),
  188. // crudStockTaskLog.FetchStockGirdNum()
  189. // ]).then(([newBillNoRes, stockGridNumRes]) => {
  190. // this.crud.form.stockBill = newBillNoRes
  191. // this.crud.form.stockGridNumName = stockGridNumRes + ' / 层位'
  192. // this.crud.form.stockGridNum = stockGridNumRes
  193. // }).catch(error => {
  194. // console.error(error)
  195. // })
  196. // },
  197. // // 提交前的验证
  198. // [CRUD.HOOK.afterValidateCU](crud) {
  199. // console.log(crud.form)
  200. // delete crud.form.stockGridNumName
  201. // delete crud.form.stockTypeName
  202. // return true
  203. // },
  204. toAdd(type) {
  205. this.$refs.eform.formVisible = true
  206. this.$refs.eform.setData(type)
  207. this.$refs.eform.form.stockRegion = '全部区域'
  208. },
  209. changeActiveTab(index) {
  210. this.prewLoading = true
  211. if (this.$refs.previewRefs.canvasPreview.lowerCanvasEl) {
  212. this.$refs.previewRefs.canvasPreview.clear()
  213. this.$refs.previewRefs.canvasPreview.dispose()
  214. }
  215. this.allCoverData = []
  216. this.tabIndex = index
  217. const params = {
  218. 'floorId': this.floorOptions[index].id
  219. }
  220. FetchInitLibraryRegionList(params).then(res => {
  221. this.allCoverData = res.content
  222. if (this.floorOptions[index].floorMap) {
  223. this.imageUrl = this.baseApi + '/api/fileRelevant/getImg?imgId=' + this.floorOptions[index].floorMap
  224. } else {
  225. this.imageUrl = this.defaultImg
  226. }
  227. if (this.allCoverData.length !== 0) {
  228. this.currentMarkData = this.allCoverData[0]
  229. const parsedSignPoints = this.allCoverData.map(item => {
  230. const signPoint = JSON.parse(item.signPoint)
  231. return {
  232. id: item.id,
  233. name: item.regionName,
  234. floorName: item.floorName,
  235. floorId: item.floorId,
  236. pointInfo: signPoint.pointInfo[0].pointInfo
  237. }
  238. })
  239. const imgInfo = JSON.parse(this.allCoverData[0].signPoint).imgInfo
  240. const result = {
  241. pointInfo: parsedSignPoints,
  242. imgInfo: imgInfo
  243. }
  244. this.$nextTick(() => {
  245. this.$refs.previewRefs.initCanvasPreview(result, this.tabIndex)
  246. })
  247. } else {
  248. this.currentMarkData = {}
  249. setTimeout(() => {
  250. this.prewLoading = false
  251. }, 500)
  252. }
  253. }).catch(() => {
  254. })
  255. },
  256. handleSlidClickFun(index) {
  257. this.rightDataIndex = null
  258. this.handleSlideToFun(index)
  259. },
  260. handleSlideToFun(index) {
  261. this.swiperActiveIndex = index
  262. this.swiperContent.slideTo(index, 500, false)
  263. this.swiperTitle.slideTo(index, 500, false)
  264. }
  265. }
  266. }
  267. </script>
  268. <style lang="scss" scoped>
  269. </style>