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

366 lines
12 KiB

7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
6 months ago
7 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
7 months ago
  1. <template>
  2. <div class="dashboard-container">
  3. <div class="dashboard-editor-container">
  4. <panel-group :top-object-num="topObjectNum" />
  5. <el-row :gutter="20" style="margin-bottom:20px;height: calc(50vh - 174px);">
  6. <el-col :xs="24" :sm="24" :lg="12">
  7. <div class="container-wrap">
  8. <span class="right-top-line" />
  9. <span class="left-bottom-line" />
  10. <h3 class="home-item-title">
  11. 盘点日志
  12. <router-link :to="{ path: '/check/check/checkLog'}">
  13. <div style="position: absolute; right: 20px; top: 20px; color: #999;" class="el-icon-more" />
  14. </router-link>
  15. </h3>
  16. <div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;">
  17. <div class="home-tab">
  18. <span :class="{'home-tab-active': flowableTabIndex == 0}">未完成({{ stockLogIncompleteData.length !==0? stockLogIncompleteData.length: 0 }})</span>
  19. <span :class="{'home-tab-active': flowableTabIndex == 1}">已完成({{ stockLogCompletedData.length !==0? stockLogCompletedData.length: 0 }})</span>
  20. <!-- <span :class="{'home-tab-active': flowableTabIndex == 2}">已完成({{ flowableData.length !==0? flowableData.length: 0 }})</span>
  21. <span :class="{'home-tab-active': flowableTabIndex == 3}" @click="toMoreProcess">更多任务</span> -->
  22. </div>
  23. <div class="home-flowable-list" style="height: calc(100% - 45px); overflow-y: auto; overflow-x: hidden;">
  24. <el-table v-if="stockLogIncompleteData.length !== 0" height="calc(100%)" :data="stockLogIncompleteData" class="archives-table" stripe style="width: 100%">
  25. <el-table-column prop="stockBill" label="盘点单号" />
  26. <el-table-column prop="stockRegion" label="目标位置" />
  27. <el-table-column prop="stockGridNum" label="目标数量" align="right">
  28. <template slot-scope="scope">
  29. <div>{{ scope.row.stockGridNum + ' / '+ (scope.row.totalGridNum?scope.row.totalGridNum:'0') +' 层位' }}</div>
  30. </template>
  31. </el-table-column>
  32. <el-table-column prop="state" label="盘点状态" align="center">
  33. <template slot-scope="scope">
  34. <span v-if="scope.row.state === 0" class="row-state row-lending state-active">已终止</span>
  35. <span v-if="scope.row.state === 1" class="row-state row-warehousing state-active">排队中</span>
  36. <span v-if="scope.row.state === 2" class="row-state row-binding state-active">盘点中</span>
  37. <span v-if="scope.row.state === 3" class="row-state row-physical state-active">已完成</span>
  38. </template>
  39. </el-table-column>
  40. <!-- <el-table-column prop="createTime" label="申请时间" width="180"> -->
  41. <!-- <template slot-scope="scope"> -->
  42. <!-- <div>{{ scope.row.createTime | parseTime }}</div> -->
  43. <!-- </template> -->
  44. <!-- </el-table-column> -->
  45. </el-table>
  46. <div v-else class="empty-main" style="height: 100%;">
  47. <svg-icon icon-class="empty" class-name="empty-img" />
  48. <p>暂无数据</p>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </el-col>
  54. <el-col :xs="24" :sm="24" :lg="12">
  55. <div class="container-wrap">
  56. <span class="right-top-line" />
  57. <span class="left-bottom-line" />
  58. <h3 class="home-item-title">
  59. 服务器监控
  60. <div style="position: absolute; right: 20px; top: 20px; color: #999; cursor: pointer;" class="el-icon-refresh" @click="refreshSystemData" />
  61. </h3>
  62. <!-- <div class="chart-wrapper"> -->
  63. <serverProgress :system-data="systemData" />
  64. <!-- </div> -->
  65. </div>
  66. </el-col>
  67. </el-row>
  68. <el-row :gutter="20" style="height:calc(50vh - 174px);">
  69. <el-col :xs="24" :sm="24" :lg="8">
  70. <!-- 档案借阅 -->
  71. <div class="container-wrap">
  72. <span class="right-top-line" />
  73. <span class="left-bottom-line" />
  74. <h3 class="home-item-title">
  75. 盘点概况
  76. </h3>
  77. <div v-if="taskStockLogData.length !== 0" class="chart-wrapper">
  78. <taskStockLogEcharts :task-stock-log-data="taskStockLogData" />
  79. </div>
  80. <div v-else class="empty-main">
  81. <svg-icon icon-class="empty" class-name="empty-img" />
  82. <p>暂无数据</p>
  83. </div>
  84. </div>
  85. </el-col>
  86. <el-col :xs="24" :sm="24" :lg="8">
  87. <!-- 档案类型 -->
  88. <div class="container-wrap">
  89. <span class="right-top-line" />
  90. <span class="left-bottom-line" />
  91. <h3 class="home-item-title">
  92. 流通统计
  93. </h3>
  94. <div class="refresh-date">2024-11-28 09:46</div>
  95. <div class="chart-wrapper" style="padding: 0 10px; margin-top: -10px;">
  96. <bookSwiper />
  97. </div>
  98. </div>
  99. </el-col>
  100. <el-col :xs="24" :sm="24" :lg="8">
  101. <!-- 档案门类 -->
  102. <div class="container-wrap">
  103. <span class="right-top-line" />
  104. <span class="left-bottom-line" />
  105. <h3 class="home-item-title">
  106. 馆藏统计
  107. </h3>
  108. <div v-if="typeData.length !== 0" class="chart-wrapper">
  109. <type-pie :type-data="typeData" />
  110. </div>
  111. <div v-else class="empty-main">
  112. <svg-icon icon-class="empty" class-name="empty-img" />
  113. <p>暂无数据</p>
  114. </div>
  115. </div>
  116. </el-col>
  117. </el-row>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import PanelGroup from './dashboard/PanelGroup'
  123. import taskStockLogEcharts from '@/views/components/echarts/taskStockLog.vue'
  124. // import lendAcross from '@/views/components/echarts/lendAcross.vue'
  125. // import catePie from '@/views/components/echarts/catePie.vue'
  126. import typePie from '@/views/components/echarts/typePie.vue'
  127. import bookSwiper from '@/views/components/bookSwiper.vue'
  128. import serverProgress from '@/views/components/echarts/serverProgress.vue'
  129. import { FetchInitHomeInfo, FetchInitStockInfo } from '@/api/stockTask/index'
  130. import { FetchInitStockLogList } from '@/api/stockTaskLog/index'
  131. import { FetchSystemInfo } from '@/api/home/cpu/index'
  132. import { mapGetters } from 'vuex'
  133. export default {
  134. name: 'Dashboard',
  135. components: {
  136. PanelGroup,
  137. // lendAcross,
  138. taskStockLogEcharts,
  139. // catePie,
  140. bookSwiper,
  141. typePie,
  142. serverProgress
  143. },
  144. data() {
  145. return {
  146. topObjectNum: {
  147. regionCount: 0,
  148. shelfCount: 0,
  149. gridCount: 0,
  150. deviceCount: 0
  151. },
  152. taskStockLogData: [],
  153. echartsTimer: null,
  154. refreshtime: 10000,
  155. systemTimer: null,
  156. systemData: {
  157. cpuPercentage: 0,
  158. memPercentage: 0,
  159. sysFilesPercentage: 0
  160. },
  161. stockLogCompletedData: [],
  162. stockLogIncompleteData: [],
  163. archivesTotalNum: 0,
  164. flowableData: [],
  165. flowableTabIndex: 0,
  166. lendData: {
  167. archivesTotalNum: null,
  168. otherData: []
  169. },
  170. cateData: [],
  171. typeData: [],
  172. addArcivesData: {
  173. addArcivesMaxCount: null,
  174. addArcivesMonth: [],
  175. addArcivesNum: [],
  176. addArcivesNumFile: []
  177. }
  178. }
  179. },
  180. computed: {
  181. ...mapGetters([
  182. 'user'
  183. ])
  184. },
  185. created() {
  186. this.handleMainData()
  187. this.getSystemInfo()
  188. this.getStockLog()
  189. this.handleInitStockInfo()
  190. },
  191. mounted() {
  192. // const _this = this
  193. // // 每隔一分钟刷新档案借阅和档案类型的数据
  194. // this.echartsTimer = setInterval(() => {
  195. // _this.lendData = {
  196. // archivesTotalNum: null,
  197. // otherData: []
  198. // }
  199. // _this.cateData = []
  200. // _this.typeData = []
  201. // _this.addArcivesData = {
  202. // addArcivesMaxCount: null,
  203. // addArcivesMonth: [],
  204. // addArcivesNum: [],
  205. // addArcivesNumFile: []
  206. // }
  207. // _this.handleMainData()
  208. // }, this.refreshtime)
  209. // 服务器监控定时更新
  210. // this.systemTimer = setInterval(() => {
  211. // _this.systemData = {
  212. // cpuPercentage: 0,
  213. // memPercentage: 0,
  214. // sysFilesPercentage: 0
  215. // }
  216. // this.getSystemInfo()
  217. // }, 3000)
  218. },
  219. methods: {
  220. getSystemInfo() {
  221. FetchSystemInfo().then(res => {
  222. // cpu 占有率 (总的cpuTotal-空闲的cpuFree)/总的cpuTotal
  223. this.systemData.cpuPercentage = Math.round((res.cpuTotal - res.cpuFree) / res.cpuTotal * 100)
  224. // 内存占比 使用的memUsed/总的memTotal
  225. this.systemData.memPercentage = Math.round(res.memUsed / res.memTotal * 100)
  226. // 磁盘占比 多个磁盘 使用总和sysFiles[i].used的和/总的总和sysFiles[i].total的和
  227. let sysFilesTotalUsed = 0
  228. let sysFilesTotal = 0
  229. res.sysFiles.forEach(item => {
  230. sysFilesTotalUsed += parseFloat(item.used)
  231. sysFilesTotal += parseFloat(item.total)
  232. })
  233. this.systemData.sysFilesPercentage = Math.round((sysFilesTotalUsed / sysFilesTotal) * 100)
  234. })
  235. },
  236. refreshSystemData() {
  237. this.systemData = {
  238. cpuPercentage: 0,
  239. memPercentage: 0,
  240. sysFilesPercentage: 0
  241. }
  242. this.getSystemInfo()
  243. },
  244. getStockLog() {
  245. FetchInitStockLogList().then(res => {
  246. this.stockLogCompletedData = res.content.filter(item => [0, 3].includes(item.state))
  247. this.stockLogIncompleteData = res.content.filter(item => [1, 2].includes(item.state))
  248. })
  249. },
  250. handleMainData() {
  251. FetchInitHomeInfo().then(data => {
  252. this.topObjectNum = {
  253. regionCount: data.regionCount,
  254. shelfCount: data.shelfCount,
  255. gridCount: data.gridCount,
  256. deviceCount: data.deviceCount
  257. }
  258. })
  259. },
  260. handleInitStockInfo(params) {
  261. FetchInitStockInfo(params).then(res => {
  262. this.taskStockLogData = [
  263. { value: res.onShelfNum - res.errorShelfNum - res.errorOrderNum, name: '正常在架' },
  264. { value: res.errorShelfNum, name: '错架' },
  265. { value: res.errorOrderNum, name: '错序' }
  266. ]
  267. }).catch(() => {
  268. })
  269. }
  270. }
  271. }
  272. </script>
  273. <style rel="stylesheet/scss" lang="scss" scoped>
  274. .dashboard-editor-container {
  275. padding: 20px;
  276. position: relative;
  277. .chart-wrapper {
  278. height: calc(100% - 55px);
  279. }
  280. }
  281. @media (max-width: 1024px) {
  282. .chart-wrapper {
  283. padding: 8px;
  284. }
  285. }
  286. .el-col {
  287. height: 100%;
  288. }
  289. .container-left,
  290. .container-right,
  291. .container-wrap,
  292. .el-card,
  293. .header-container-wrap {
  294. min-height: 100%;
  295. }
  296. .container-wrap {
  297. min-height: auto;
  298. height: 100%;
  299. }
  300. .home-item-title{
  301. position: relative;
  302. padding: 18px 0 18px 15px;
  303. font-size: 16px;
  304. color: #0C0E1E;
  305. &::before{
  306. position: absolute;
  307. left: 0;
  308. top: 50%;
  309. content: "";
  310. width: 3px;
  311. height: 16px;
  312. background-color: #0348F3;
  313. transform: translateY(-50%);
  314. }
  315. }
  316. .home-flowable{
  317. padding: 0 20px;
  318. }
  319. .home-tab{
  320. display: flex;
  321. justify-content: flex-start;
  322. span{
  323. display: block;
  324. margin-right: 30px;
  325. padding-bottom: 3px;
  326. border-bottom: 3px solid #fff;
  327. &.home-tab-active{
  328. color: #0348F3;
  329. // border-bottom: 3px solid #0348F3;
  330. }
  331. }
  332. }
  333. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar {
  334. width: 5px !important;
  335. height: 5px !important;
  336. background-color: #DDE8FB !important;
  337. }
  338. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-thumb {
  339. border-radius: 3px;
  340. background-color: #4578F6 !important;
  341. }
  342. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-thumb:hover {
  343. background-color: #4578F6 !important;
  344. }
  345. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-corner {
  346. background-color: #DDE8FB !important;
  347. }
  348. .refresh-date{
  349. position: absolute;
  350. right: 14px;
  351. top: 10px;
  352. font-size: 12px;
  353. line-height: 30px;
  354. }
  355. </style>