audit-select-project.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <a-modal
  3. :class="$style.mainModal"
  4. :body-style="bodyStyle"
  5. :title="title"
  6. :destroy-on-close="true"
  7. :visible="visible"
  8. :width="modalWidth"
  9. @ok="handleOk"
  10. @cancel="handleCancel"
  11. >
  12. <!-- 列表 -->
  13. <sd-data-table-ex
  14. ref="SJMXDataTable"
  15. form-id="iamAuditProject"
  16. data-url="api/xcoa-mobile/v1/iamauditproject/myProjectList"
  17. :pagination="{ pageSize: 10 }"
  18. :check-type="'radio'"
  19. :columns="columns"
  20. show-selection
  21. :process-res="processRes"
  22. @onChange="onChange"
  23. >
  24. </sd-data-table-ex>
  25. </a-modal>
  26. </template>
  27. <script>
  28. import moment from 'moment'
  29. import components from './_import-components/audit-select-project-import'
  30. const columns = [
  31. {
  32. title: '序号',
  33. dataIndex: 'sortNumber',
  34. width: '20%',
  35. customRender: (text, record, index) => `${index + 1}`,
  36. },
  37. {
  38. title: '项目标题',
  39. dataIndex: 'projectTitle',
  40. },
  41. ]
  42. export default {
  43. name: 'AuditSelectProject',
  44. metaInfo: {
  45. title: '项目选择器',
  46. },
  47. components: {
  48. ...components,
  49. },
  50. props: {
  51. // 弹出窗标题
  52. title: {
  53. type: String,
  54. default: '项目选择器',
  55. },
  56. // 弹出窗宽度
  57. modalWidth: {
  58. type: String,
  59. default: '1200px',
  60. },
  61. // 弹出窗显示参数
  62. visible: {
  63. type: Boolean,
  64. default: false,
  65. },
  66. },
  67. data() {
  68. return {
  69. bodyStyle: {
  70. // padding: 0,
  71. },
  72. // 列表展示用
  73. columns,
  74. expand: false,
  75. period: [],
  76. }
  77. },
  78. methods: {
  79. moment,
  80. processRes(data) {
  81. let index = 0
  82. data.data.forEach((item) => {
  83. item.id = this.$refs.SJMXDataTable.localPagination.current + '-' + index
  84. index++
  85. })
  86. return data
  87. },
  88. handleOk(e) {
  89. this.$parent.visibleP = !this.$parent.visibleP
  90. // 列表选择事件,返回选择的数据
  91. this.$emit(
  92. 'listPSelected',
  93. this.$refs.SJMXDataTable.getSelectedRowKeys(),
  94. this.$refs.SJMXDataTable.getSelectedRows()
  95. )
  96. },
  97. handleCancel(e) {
  98. this.$parent.visibleP = !this.$parent.visibleP
  99. },
  100. // 翻页操作
  101. onChange(pagination, filters, sorter) {
  102. this.pageSize = pagination.pageSize
  103. this.startPosition = (pagination.current - 1) * pagination.pageSize
  104. },
  105. // 开启关闭
  106. searchedClick() {
  107. this.expand = false
  108. },
  109. },
  110. }
  111. </script>
  112. <style module lang="scss">
  113. @use '@/common/design' as *;
  114. .main-modal {
  115. :global(.ant-calendar-picker) {
  116. width: 100%;
  117. }
  118. }
  119. </style>