index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <ContentWrap>
  3. <!-- 列表 -->
  4. <XTable @register="registerTable">
  5. <template #toolbar_buttons>
  6. <!-- 操作:导出 -->
  7. <XButton
  8. type="warning"
  9. preIcon="ep:download"
  10. :title="t('action.export')"
  11. v-hasPermi="['pay:refund:export']"
  12. @click="exportList('退款订单.xls')"
  13. />
  14. </template>
  15. <template #actionbtns_default="{ row }">
  16. <!-- 操作:详情 -->
  17. <XTextButton
  18. preIcon="ep:view"
  19. :title="t('action.detail')"
  20. v-hasPermi="['pay:refund:query']"
  21. @click="handleDetail(row.id)"
  22. />
  23. </template>
  24. </XTable>
  25. </ContentWrap>
  26. <XModal v-model="dialogVisible" :title="t('action.detail')">
  27. <!-- 对话框(详情) -->
  28. <Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
  29. <!-- 操作按钮 -->
  30. <template #footer>
  31. <el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
  32. </template>
  33. </XModal>
  34. </template>
  35. <script setup lang="ts" name="Refund">
  36. import { allSchemas } from './refund.data'
  37. import * as RefundApi from '@/api/pay/refund'
  38. const { t } = useI18n() // 国际化
  39. // 列表相关的变量
  40. const [registerTable, { exportList }] = useXTable({
  41. allSchemas: allSchemas,
  42. getListApi: RefundApi.getRefundPage,
  43. exportListApi: RefundApi.exportRefund
  44. })
  45. // ========== CRUD 相关 ==========
  46. const dialogVisible = ref(false) // 是否显示弹出层
  47. const detailData = ref() // 详情 Ref
  48. // 详情操作
  49. const handleDetail = async (rowId: number) => {
  50. // 设置数据
  51. detailData.value = RefundApi.getRefund(rowId)
  52. dialogVisible.value = true
  53. }
  54. </script>