交通管理局公文项目
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.

479 lines
17 KiB

1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
10 months ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year 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. <div style="position: absolute; right: 20px; top: 0; display: flex; justify-content: flex-end; align-items: center;">
  13. <el-checkbox v-model="isOriginal" @change="handleOriginalChange">仅显示原件</el-checkbox>
  14. <span v-if="miodTableData.length !== 0" style=" display: block; line-height: 54px; font-weight: normal; color: rgb(153, 153, 153); margin-left: 10px;"><i class="el-icon-receiving" style="margin-right: 6px;" />{{ miodTableData.length }}</span>
  15. </div>
  16. </h3>
  17. <div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;">
  18. <!-- <div class="home-tab">
  19. <span :class="{'home-tab-active': flowableTabIndex == 0}">待处理({{ flowableData.length !==0? flowableData.length: 0 }})</span>
  20. <span :class="{'home-tab-active': flowableTabIndex == 1}" @click="toMoreProcess">更多流程</span>
  21. </div> -->
  22. <div class="home-flowable-list" style="height: calc(100% - 45px); overflow-y: auto; overflow-x: hidden;">
  23. <el-table v-if="miodTableData.length !== 0" height="calc(100%)" :data="miodTableData" stripe style="width: 100%" :show-header="false" @cell-dblclick="tableDoubleClick">
  24. <el-table-column prop="title" label="标题" width="450" show-overflow-tooltip>
  25. <template slot-scope="scope">
  26. <span>[{{ scope.row.reg_no }}] - {{ scope.row.borrow_name }} - {{ scope.row.maintitle }}</span>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="latest_time" label="申请时间" width="180">
  30. <template slot-scope="scope">
  31. <div>{{ scope.row.latest_time }}</div>
  32. </template>
  33. </el-table-column>
  34. <el-table-column prop="status" label="状态" width="100" align="right">
  35. <template slot-scope="scope">
  36. <div>
  37. <span v-if="scope.row.status==='逾期'" class="row-state cancel-state">{{ scope.row.status }}</span>
  38. <span v-if="scope.row.status==='即将到期'" class="row-state soon-state">{{ scope.row.status }}</span>
  39. <span v-if="scope.row.status==='传阅中'" class="row-state end-state">{{ scope.row.status }}</span>
  40. </div>
  41. </template>
  42. </el-table-column>
  43. </el-table>
  44. <div v-else class="empty-main" style="height: 100%;">
  45. <svg-icon icon-class="empty" class-name="empty-img" />
  46. <p>暂无数据</p>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </el-col>
  52. <el-col :xs="24" :sm="24" :lg="12">
  53. <div class="container-wrap">
  54. <span class="right-top-line" />
  55. <span class="left-bottom-line" />
  56. <h3 class="home-item-title">
  57. 办理时限提醒
  58. <span v-if="remindData.length !== 0" style="position: absolute; right: 20px; top: 0; display: block; line-height: 54px; font-weight: normal; color: rgb(153, 153, 153);"><i class="el-icon-receiving" style="margin-right: 6px;" />{{ remindData.length }}</span>
  59. </h3>
  60. <!-- <serverProgress :system-data="systemData" /> -->
  61. <div class="home-flowable" style="height: calc(100% - 54px); overflow-x: hidden;">
  62. <div class="home-flowable-list" style="height: calc(100% - 45px); overflow-y: auto; overflow-x: hidden;">
  63. <el-table v-if="remindData.length !== 0" height="calc(100%)" :data="remindData" stripe style="width: 100%" :show-header="false" @cell-dblclick="tableDoubleClick">
  64. <el-table-column prop="title" label="标题" min-width="450" show-overflow-tooltip>
  65. <template slot-scope="scope">
  66. <span>[{{ scope.row.reg_no }}] - {{ scope.row.maintitle }}</span>
  67. </template>
  68. </el-table-column>
  69. <el-table-column prop="latest_time" label="申请时间" width="180" align="right">
  70. <template slot-scope="scope">
  71. <div>{{ scope.row.latest_time }}</div>
  72. </template>
  73. </el-table-column>
  74. <!-- <el-table-column prop="status" label="状态" width="100" align="right">
  75. <template slot-scope="scope">
  76. <div>
  77. <span v-if="scope.row.status==='逾期'" class="row-state cancel-state">{{ scope.row.status }}</span>
  78. <span v-if="scope.row.status==='即将到期'" class="row-state soon-state">{{ scope.row.status }}</span>
  79. <span v-if="scope.row.status==='传阅中'" class="row-state end-state">{{ scope.row.status }}</span>
  80. </div>
  81. </template>
  82. </el-table-column> -->
  83. </el-table>
  84. <div v-else class="empty-main" style="height: 100%;">
  85. <svg-icon icon-class="empty" class-name="empty-img" />
  86. <p>暂无数据</p>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. </el-col>
  92. </el-row>
  93. <el-row :gutter="20" style="height:calc(50vh - 174px);">
  94. <!-- <el-col :xs="24" :sm="24" :lg="8">
  95. <div class="container-wrap">
  96. <span class="right-top-line" />
  97. <span class="left-bottom-line" />
  98. <h3 class="home-item-title">
  99. 档案统计
  100. </h3>
  101. <div v-if="lendData.otherData.length !== 0" class="chart-wrapper">
  102. <lend-across :lend-data="lendData" />
  103. </div>
  104. <div v-else class="empty-main">
  105. <svg-icon icon-class="empty" class-name="empty-img" />
  106. <p>暂无数据</p>
  107. </div>
  108. </div>
  109. </el-col> -->
  110. <el-col :xs="24" :sm="24" :lg="12">
  111. <!-- 档案类型 -->
  112. <div class="container-wrap">
  113. <span class="right-top-line" />
  114. <span class="left-bottom-line" />
  115. <h3 class="home-item-title">
  116. 公文新增
  117. </h3>
  118. <div class="chart-wrapper">
  119. <cate-pie :add-arcives-data="addArcivesData" />
  120. </div>
  121. </div>
  122. </el-col>
  123. <el-col :xs="24" :sm="24" :lg="12">
  124. <!-- 档案门类 -->
  125. <div class="container-wrap">
  126. <span class="right-top-line" />
  127. <span class="left-bottom-line" />
  128. <h3 class="home-item-title">
  129. 公文统计
  130. </h3>
  131. <div v-if="typeData.length !== 0" class="chart-wrapper">
  132. <type-pie :type-data="typeData" />
  133. </div>
  134. <div v-else class="empty-main">
  135. <svg-icon icon-class="empty" class-name="empty-img" />
  136. <p>暂无数据</p>
  137. </div>
  138. </div>
  139. </el-col>
  140. </el-row>
  141. </div>
  142. <MidoArchivesInfo ref="archivesInfo" :is-mido-record="true" :parent-info="parentInfo" :page-type="pageType" />
  143. </div>
  144. </template>
  145. <script>
  146. import PanelGroup from './dashboard/PanelGroup'
  147. // import lendAcross from '@/views/components/echarts/lendAcross.vue'
  148. import catePie from '@/views/components/echarts/catePie.vue'
  149. import typePie from '@/views/components/echarts/typePie.vue'
  150. // import serverProgress from '@/views/components/echarts/serverProgress.vue'
  151. import { FetchInitStatisBase, FetchDocumentTypeByTime, FetchDocumentByDocDepartment, FetchHomeBorrowLog, FetchHomeRemindHandle } from '@/api/system/documentArchives'
  152. import { FetchSystemInfo } from '@/api/home/cpu/index'
  153. import { mapGetters } from 'vuex'
  154. import MidoArchivesInfo from '@/views/archivesMIOD/miodLibrary/module/detail'
  155. export default {
  156. name: 'Dashboard',
  157. components: {
  158. PanelGroup,
  159. // lendAcross,
  160. catePie,
  161. typePie,
  162. MidoArchivesInfo
  163. // serverProgress
  164. },
  165. data() {
  166. return {
  167. topObjectNum: {
  168. documentTotal: 0,
  169. notCirculate: 0,
  170. circulateing: 0,
  171. circulated: 0
  172. },
  173. archivesTotalNum: 0,
  174. miodTableData: [],
  175. flowableTabIndex: 0,
  176. lendData: {
  177. archivesTotalNum: null,
  178. otherData: []
  179. },
  180. cateData: [],
  181. typeData: [],
  182. addArcivesData: {
  183. addArcivesMaxCount: null,
  184. addArcivesMonth: [],
  185. addArcivesNum: []
  186. },
  187. echartsTimer: null,
  188. refreshtime: 10000,
  189. systemTimer: null,
  190. systemData: {
  191. cpuPercentage: 0,
  192. memPercentage: 0,
  193. sysFilesPercentage: 0
  194. },
  195. remindData: [],
  196. parentInfo: null,
  197. pageType: 'miodRecord',
  198. isOriginal: true
  199. }
  200. },
  201. computed: {
  202. ...mapGetters([
  203. 'user'
  204. ])
  205. },
  206. created() {
  207. this.getTopData()
  208. this.getHomeBorrowLog()
  209. this.getHomeRemindHandle()
  210. this.getSystemInfo()
  211. this.getDocumentTypeByTime()
  212. this.getDocumentByDocDepartment()
  213. },
  214. mounted() {
  215. // const _this = this
  216. // // 每隔一分钟刷新档案借阅和档案类型的数据
  217. // this.echartsTimer = setInterval(() => {
  218. // _this.lendData = {
  219. // archivesTotalNum: null,
  220. // otherData: []
  221. // }
  222. // _this.cateData = []
  223. // _this.typeData = []
  224. // _this.addArcivesData = {
  225. // addArcivesMaxCount: null,
  226. // addArcivesMonth: [],
  227. // addArcivesNum: [],
  228. // addArcivesNumFile: []
  229. // }
  230. // }, this.refreshtime)
  231. // 服务器监控定时更新
  232. // this.systemTimer = setInterval(() => {
  233. // _this.systemData = {
  234. // cpuPercentage: 0,
  235. // memPercentage: 0,
  236. // sysFilesPercentage: 0
  237. // }
  238. // this.getSystemInfo()
  239. // }, 3000)
  240. },
  241. methods: {
  242. handleOriginalChange() {
  243. this.getHomeBorrowLog()
  244. },
  245. getHomeBorrowLog() {
  246. // detailsType null全部 1.原件 2.复印件
  247. const param = {
  248. 'detailsType': this.isOriginal ? 1 : null
  249. }
  250. FetchHomeBorrowLog(param).then(res => {
  251. if (res && Array.isArray(res)) {
  252. this.miodTableData = res
  253. } else {
  254. this.miodTableData = []
  255. }
  256. })
  257. },
  258. getHomeRemindHandle() {
  259. FetchHomeRemindHandle().then(res => {
  260. if (res && Array.isArray(res)) {
  261. this.remindData = res.map(item => {
  262. return {
  263. reg_no: item[0],
  264. maintitle: item[1],
  265. latest_time: item[2],
  266. document_id: item[3],
  267. parents_id: item[4]
  268. }
  269. })
  270. } else {
  271. this.remindData = []
  272. }
  273. })
  274. },
  275. tableDoubleClick(row) {
  276. console.log('row', row)
  277. this.parentInfo = row
  278. this.$nextTick(() => {
  279. this.$refs.archivesInfo.archivesInfoVisible = true
  280. this.$refs.archivesInfo.archivesTabIndex = 0
  281. this.$refs.archivesInfo.getDetial()
  282. })
  283. },
  284. getSystemInfo() {
  285. FetchSystemInfo().then(res => {
  286. console.log('res', res)
  287. if (res && Object.keys(res).length) {
  288. // cpu 占有率 (总的cpuTotal-空闲的cpuFree)/总的cpuTotal
  289. // cpuSy cpu使用率 cpuFree cpu空闲率
  290. // this.systemData.cpuPercentage = Math.round((res.cpuTotal - res.cpuFree) / res.cpuTotal * 100)
  291. this.systemData.cpuPercentage = Math.round(res.cpuSy / (res.cpuSy + res.cpuFree) * 100)
  292. // 内存占比 使用的memUsed/总的memTotal
  293. this.systemData.memPercentage = Math.round(res.memUsed / res.memTotal * 100)
  294. // 磁盘占比 多个磁盘 使用总和sysFiles[i].used的和/总的总和sysFiles[i].total的和
  295. let sysFilesTotalUsed = 0
  296. let sysFilesTotal = 0
  297. res.sysFiles.forEach(item => {
  298. sysFilesTotalUsed += parseFloat(item.used)
  299. sysFilesTotal += parseFloat(item.total)
  300. })
  301. this.systemData.sysFilesPercentage = Math.round((sysFilesTotalUsed / sysFilesTotal) * 100)
  302. } else {
  303. this.systemData = {
  304. cpuPercentage: 0,
  305. memPercentage: 0,
  306. sysFilesPercentage: 0
  307. }
  308. }
  309. })
  310. },
  311. toMoreProcess() {
  312. this.$router.push({ path: '/user/center?activeIndex=2' })
  313. },
  314. getTopData() {
  315. FetchInitStatisBase().then(data => {
  316. this.topObjectNum = {
  317. notCirculate: data.notCirculate, // 未传阅数量
  318. documentTotal: data.documentTotal, // 公文总数
  319. circulateing: data.circulateing, // 传阅中
  320. circulated: data.circulated // 已完成
  321. }
  322. })
  323. },
  324. getDocumentTypeByTime() {
  325. FetchDocumentTypeByTime().then(data => {
  326. let maxCount = 0
  327. data.forEach(archive => {
  328. if (archive.count > maxCount) {
  329. maxCount = archive.count
  330. }
  331. })
  332. this.addArcivesData.addArcivesMaxCount = maxCount
  333. // 获取当前日期信息
  334. const currentDate = new Date()
  335. const currentYear = currentDate.getFullYear()
  336. const currentMonth = currentDate.getMonth() + 1 // 月份从1开始
  337. // 生成包含本月的近12个月数据
  338. const result = [] // 存储完整月份数据
  339. const xResult = [] // 存储x轴标签
  340. for (let i = 11; i >= 0; i--) {
  341. // 计算当前循环的年月(从当前月向前推i个月)
  342. let year = currentYear
  343. let month = currentMonth - i
  344. // 调整年月,如果月份小于等于0,减少年份并调整月份
  345. while (month <= 0) {
  346. month += 12
  347. year -= 1
  348. }
  349. // 格式化月份为两位数字
  350. const formattedMonth = month.toString().padStart(2, '0')
  351. // 添加到x轴标签
  352. xResult.push(`${year}/${month}`)
  353. // 查找对应月份的数据(假设数据结构包含year和month字段)
  354. const found = data.find(archive =>
  355. archive.month === formattedMonth && (archive.year === undefined || parseInt(archive.year) === year)
  356. )
  357. // 添加到结果数组,有数据则使用,没有则为0
  358. result.push({
  359. year,
  360. month,
  361. archivesCount: found ? found.count : 0,
  362. singlesCount: 0
  363. })
  364. }
  365. // 更新数据
  366. this.addArcivesData.addArcivesMonth = xResult
  367. this.addArcivesData.addArcivesNum = result.map(obj => obj.archivesCount)
  368. })
  369. },
  370. getDocumentByDocDepartment() {
  371. FetchDocumentByDocDepartment().then(data => {
  372. this.typeData = data.map(item => ({
  373. name: item.docDepartment,
  374. value: item.count
  375. }))
  376. })
  377. }
  378. }
  379. }
  380. </script>
  381. <style rel="stylesheet/scss" lang="scss" scoped>
  382. .dashboard-editor-container {
  383. padding: 20px;
  384. position: relative;
  385. .chart-wrapper {
  386. height: calc(100% - 55px);
  387. }
  388. }
  389. @media (max-width: 1024px) {
  390. .chart-wrapper {
  391. padding: 8px;
  392. }
  393. }
  394. .el-col {
  395. height: 100%;
  396. }
  397. .container-left,
  398. .container-right,
  399. .container-wrap,
  400. .el-card,
  401. .header-container-wrap {
  402. min-height: 100%;
  403. }
  404. .container-wrap {
  405. min-height: auto;
  406. height: 100%;
  407. }
  408. .home-item-title{
  409. position: relative;
  410. padding: 18px 0 18px 15px;
  411. font-size: 16px;
  412. color: #0C0E1E;
  413. &::before{
  414. position: absolute;
  415. left: 0;
  416. top: 50%;
  417. content: "";
  418. width: 3px;
  419. height: 16px;
  420. background-color: #0348F3;
  421. transform: translateY(-50%);
  422. }
  423. }
  424. .home-flowable{
  425. padding: 0 20px;
  426. }
  427. .home-tab{
  428. display: flex;
  429. justify-content: flex-start;
  430. span{
  431. display: block;
  432. margin-right: 30px;
  433. padding-bottom: 3px;
  434. border-bottom: 3px solid #fff;
  435. cursor: pointer;
  436. &.home-tab-active{
  437. color: #0348F3;
  438. border-bottom: 3px solid #0348F3;
  439. }
  440. }
  441. }
  442. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar {
  443. width: 5px !important;
  444. height: 5px !important;
  445. background-color: #DDE8FB !important;
  446. }
  447. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-thumb {
  448. border-radius: 3px;
  449. background-color: #4578F6 !important;
  450. }
  451. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-thumb:hover {
  452. background-color: #4578F6 !important;
  453. }
  454. ::v-deep .home-flowable-list .el-table__body-wrapper::-webkit-scrollbar-corner {
  455. background-color: #DDE8FB !important;
  456. }
  457. </style>