index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <div class="layout-pd" >
  3. <el-row>
  4. <!--操作-->
  5. <el-col :xs="24" >
  6. <el-card style="text-align: center;font-weight: 600;font-size: large;">
  7. 信息发送列表
  8. </el-card>
  9. </el-col>
  10. <!--表格-->
  11. <el-col :xs="24" >
  12. <el-card style="height: 70vh" class="my-fill mt8" shadow="hover">
  13. <el-table ref="multipleTableRef"
  14. v-loading="Data.loading"
  15. stripe :data="Data.tableModel"
  16. row-key="id"
  17. style="width: 100%" >
  18. <el-table-column v-for="column in Data.dynamicColumns" :key="column.prop" :prop="column.prop" :label="column.label" />
  19. </el-table>
  20. <div class="my-flex my-flex-end" style="margin-top: 20px">
  21. <el-pagination
  22. v-model:currentPage="Data.pageInput.currentPage"
  23. v-model:page-size="Data.pageInput.pageSize"
  24. :total="Data.total"
  25. :page-sizes="[5, 10, 20, 50, 100]"
  26. small
  27. background
  28. @size-change="onSizeChange"
  29. @current-change="onCurrentChange"
  30. layout="total, sizes, prev, pager, next, jumper"
  31. />
  32. </div>
  33. </el-card>
  34. </el-col>
  35. </el-row>
  36. </div>
  37. </template>
  38. <script setup lang="ts" name="partsManagement/oilGun">
  39. import {onMounted, reactive, watch} from "vue";
  40. import { sendMessageApi } from "/@/api/admin/AlarmService/sendMessageApi";
  41. import { Filter } from "@element-plus/icons";
  42. /**页面对象 */
  43. const Data = reactive({
  44. /** 选择框列表 */
  45. statusList : [] as any,
  46. supplierList : [] as any,
  47. /**加载显示 */
  48. loading: false,
  49. /**条件查询模块 */
  50. Filter:{
  51. },
  52. /**表格信息 */
  53. tableModel: [],
  54. /**动态表头 */
  55. dynamicColumns: [
  56. { prop: 'pushUserid', label: '推送用户id' },
  57. { prop: 'pushUser', label: '推送用户' },
  58. { prop: 'content', label: '推送内容' },
  59. { prop: 'isPushed', label: '是否推送' },
  60. { prop: 'pushTime', label: '推送时间' },
  61. { prop: 'alarmhistoryID', label: '报警id' },
  62. { prop: 'taskPriority', label: '优先级' },
  63. ],
  64. /**分页总数 */
  65. total: 0,
  66. /**分页标识 */
  67. pageInput:{
  68. currentPage: 1,
  69. pageSize: 10,
  70. },
  71. })
  72. onMounted(() => {
  73. init()
  74. })
  75. // 条件查询
  76. const init = async () => {
  77. // Data.loading = true
  78. const res: any = await new sendMessageApi().getData({ ...Data.pageInput, filter: Data.Filter })
  79. console.log(res)
  80. // Data.tableModel = res?.data ?? []
  81. // Data.total = res?.data?.length ?? 0
  82. // Data.loading = false
  83. }
  84. /**
  85. * 页条变化
  86. * @param val
  87. */
  88. const onSizeChange = (val: number) => {
  89. Data.pageInput.pageSize = val
  90. // init()
  91. }
  92. /**
  93. * 页数 变化
  94. * @param val
  95. */
  96. const onCurrentChange = (val: number) => {
  97. Data.pageInput.currentPage = val
  98. // init()
  99. }
  100. </script>
  101. <style scoped lang="scss">
  102. .my-el-link {
  103. font-size: 14px;
  104. }
  105. .el-form .el-col.mb20 {
  106. margin: 0 !important;
  107. }
  108. .el-input, .el-select {
  109. width: 240px;
  110. }
  111. </style>