spic-audit-dsc-topfive-list.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div style="padding: 20px; padding-top: 0" class="reporttablecardxm">
  3. <div
  4. style="position: absolute; padding-top: 10px; line-height: 32px"
  5. class="header_sd-header_common"
  6. >
  7. <div :class="$style.titlepoint"></div>
  8. <span :class="['toptitle', $style.toptitle]">审计分类问题数量分布</span>
  9. </div>
  10. <sd-data-table
  11. ref="dataTable"
  12. :columns="columns"
  13. :projectlist="true"
  14. :data-url="dataUrl"
  15. :actions="actions"
  16. :process-req="processReq"
  17. :process-res="processRes"
  18. :defultpagination-pagesize="50"
  19. />
  20. </div>
  21. </template>
  22. <script>
  23. import { Message } from 'ant-design-vue'
  24. import TableActionTypes from '@/common/services/table-action-types'
  25. import download from '@/common/services/download'
  26. import auditService from './iam-audit-dsc-service'
  27. import components from './_import-components/spic-audit-dsc-topfive-list-import'
  28. export default {
  29. name: 'SpicAuditDscTopfiveList',
  30. metaInfo: {
  31. title: '审计分类问题数量分布',
  32. },
  33. components,
  34. data() {
  35. return {
  36. year1: '2023',
  37. params: null,
  38. columns: [],
  39. year: '',
  40. data: [],
  41. actions: [
  42. {
  43. label: '导出',
  44. id: 'export',
  45. permission: null,
  46. type: TableActionTypes.primary,
  47. callback: () => {
  48. const params = JSON.parse(this.$route.query.params)
  49. if (this.$route.query.type === 'top5list') {
  50. auditService
  51. .exportTop5List(params)
  52. .then((data) => {
  53. const url = URL.createObjectURL(data)
  54. download(url, '审计分类问题数量分布列表导出.xls')
  55. })
  56. .catch(() => {
  57. Message.error('导出失败')
  58. })
  59. }
  60. },
  61. },
  62. ],
  63. }
  64. },
  65. computed: {
  66. dataUrl() {
  67. return 'api/xcoa-mobile/v1/spicDecisionSupportCenter/getTopCategoryList'
  68. },
  69. },
  70. mounted() {
  71. const year = this.$route.query.year
  72. this.columns.push({ title: '一级分类名称', dataIndex: '' })
  73. this.columns.push({ title: '二级分类名称', dataIndex: '' })
  74. this.columns.push({ title: year - 3, dataIndex: '' })
  75. this.columns.push({ title: year - 2, dataIndex: '' })
  76. this.columns.push({ title: year - 1, dataIndex: '' })
  77. this.columns.push({ title: year, dataIndex: '' })
  78. },
  79. methods: {
  80. processRes(res) {
  81. return res
  82. },
  83. processReq(req) {
  84. const params = JSON.parse(this.$route.query.params)
  85. req.data = {
  86. ...req.data,
  87. ...params,
  88. }
  89. if (req.data.pageIndex === undefined) {
  90. req.data.pageIndex = req.data.startPosition
  91. }
  92. if (req.data.pageSize === undefined) {
  93. req.data.pageSize = 10
  94. }
  95. return req
  96. },
  97. },
  98. }
  99. </script>
  100. <style module lang="scss">
  101. @use '@/common/design' as *;
  102. .titlepoint {
  103. position: absolute;
  104. top: 12px;
  105. left: 20px;
  106. width: 8px;
  107. height: 27px;
  108. background: #1890ff;
  109. border-radius: 8px;
  110. }
  111. .toptitle {
  112. position: absolute;
  113. top: 9px;
  114. left: 40px;
  115. width: 250px;
  116. font-size: 22px;
  117. font-weight: bold;
  118. color: #404040;
  119. }
  120. </style>