xm-audit-mapcoverage-list.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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]">审计覆盖情况:{{ unitName }}</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. <template slot="islink" slot-scope="text, record">
  21. <a v-if="unitCode === '100000'" :title="text" @click="rowClick(record)">{{ text }}</a>
  22. <span v-if="unitCode !== '100000'" :title="text">{{ text }}</span>
  23. </template>
  24. </sd-data-table>
  25. </div>
  26. </template>
  27. <script>
  28. import { Message } from 'ant-design-vue'
  29. import TableActionTypes from '@/common/services/table-action-types'
  30. import download from '@/common/services/download'
  31. import MapService from './map-service.js'
  32. import components from './_import-components/xm-audit-mapcoverage-list-import'
  33. export default {
  34. name: 'XmAuditMapcoverageList',
  35. metaInfo: {
  36. title: '审计覆盖情况',
  37. },
  38. components,
  39. data() {
  40. return {
  41. params: null,
  42. columns: [],
  43. year: '',
  44. data: [],
  45. unitName: '',
  46. unitCode: '',
  47. actions: [
  48. {
  49. label: '导出',
  50. id: 'export',
  51. permission: null,
  52. type: TableActionTypes.primary,
  53. callback: () => {
  54. const params = JSON.parse(this.$route.query.params)
  55. // if (this.$route.query.type === 'fourYearCoverage') {
  56. MapService.exportCoverageList(params)
  57. .then((data) => {
  58. const url = URL.createObjectURL(data)
  59. download(url, '审计覆盖情况列表导出.xls')
  60. })
  61. .catch(() => {
  62. Message.error('导出失败')
  63. })
  64. // }
  65. },
  66. },
  67. ],
  68. }
  69. },
  70. computed: {
  71. dataUrl() {
  72. return 'api/xcoa-mobile/v1/iamtarget/getCoverageList'
  73. },
  74. },
  75. mounted() {
  76. const params = this.$route.query.params
  77. const year = this.$route.query.year
  78. this.columns.push({
  79. title: '序号',
  80. width: '80px',
  81. })
  82. this.columns.push({
  83. title: '单位名称',
  84. dataIndex: '1',
  85. scopedSlots: { customRender: 'islink' },
  86. })
  87. this.columns.push({ title: '单位ID', dataIndex: '2', sdHidden: true })
  88. this.columns.push({ title: year - 3, dataIndex: '3' })
  89. this.columns.push({ title: year - 2, dataIndex: '4' })
  90. this.columns.push({ title: year - 1, dataIndex: '5' })
  91. this.columns.push({ title: year, dataIndex: '6' })
  92. },
  93. methods: {
  94. processRes(res) {
  95. this.unitName = res.properties.unitName
  96. this.unitCode = res.properties.unitCode
  97. return res
  98. },
  99. processReq(req) {
  100. const params = JSON.parse(this.$route.query.params)
  101. req.data = {
  102. ...req.data,
  103. ...params,
  104. }
  105. if (req.data.pageIndex === undefined) {
  106. req.data.pageIndex = req.data.startPosition
  107. }
  108. if (req.data.pageSize === undefined) {
  109. req.data.pageSize = 10
  110. }
  111. return req
  112. },
  113. rowClick(record) {
  114. // 处理点击事件
  115. console.log(record)
  116. const now = new Date()
  117. const year = now.getFullYear()
  118. const param = {}
  119. param.type = 'gn'
  120. param.name = '境内'
  121. param.orgId = record[2]
  122. window.open(
  123. '#/xm-audit-mapcoverage-list?params=' +
  124. encodeURIComponent(JSON.stringify(param)) +
  125. '&year=' +
  126. year
  127. )
  128. },
  129. },
  130. }
  131. </script>
  132. <style module lang="scss">
  133. @use '@/common/design' as *;
  134. .titlepoint {
  135. position: absolute;
  136. top: 12px;
  137. left: 20px;
  138. width: 8px;
  139. height: 27px;
  140. background: #1890ff;
  141. border-radius: 8px;
  142. }
  143. .toptitle {
  144. position: absolute;
  145. top: 9px;
  146. left: 40px;
  147. width: 1250px;
  148. font-size: 22px;
  149. font-weight: bold;
  150. color: #404040;
  151. }
  152. </style>