leaveMsgList.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <!-- power="message:add" -->
  3. <div class="body-layer" style="padding: 0">
  4. <el-table
  5. ref="multipleTable"
  6. :data="state.table.rows"
  7. tooltip-effect="dark"
  8. style="width: 100%; max-height: 540px"
  9. >
  10. <el-table-column label="留言内容" prop="content" v-slot:default="{ row }">
  11. <el-tooltip
  12. class="item"
  13. effect="dark"
  14. :content="row.content"
  15. placement="bottom-start"
  16. v-if="row.content && row.content.length > 30"
  17. >
  18. <a class="msg-content"> {{ row.content.substr(0, 30) }}... </a>
  19. </el-tooltip>
  20. <a class="msg-content" v-else>
  21. {{ row.content }}
  22. </a>
  23. </el-table-column>
  24. <el-table-column label="创建人" prop="userName" width="150"></el-table-column>
  25. <el-table-column
  26. label="创建日期"
  27. prop="createTime"
  28. v-slot:default="{ row }"
  29. width="180"
  30. >
  31. {{ format(row.createTime) }}
  32. </el-table-column>
  33. </el-table>
  34. <com-pagination
  35. @size-change="changPageSize"
  36. @current-change="changPageCurrent"
  37. :current-page="state.pag.currentPage"
  38. :page-size="state.pag.size"
  39. :total="state.pag.total"
  40. />
  41. </div>
  42. </template>
  43. <script setup lang="ts">
  44. import { usePagging } from "@/hook/pagging";
  45. import comPagination from "@/components/pagination/index.vue";
  46. import { FireLeaveMsg, getFireLeaveMsgPagging } from "@/app/fire/store/fire";
  47. import { dateFormat } from "@/util";
  48. import { QuiskExpose } from "@/helper/mount";
  49. const props = defineProps<{
  50. projectId: string;
  51. onAddLeaveMsg: (projectId: string) => boolean | Promise<boolean>;
  52. }>();
  53. const { state, refresh, changPageSize, changPageCurrent } = usePagging({
  54. get: getFireLeaveMsgPagging,
  55. paramsTemlate: { projectId: props.projectId },
  56. });
  57. const format = (date: number) => dateFormat(new Date(date), "yyyy-MM-dd hh:mm");
  58. defineExpose<QuiskExpose>({
  59. async submit() {
  60. if (await props.onAddLeaveMsg(props.projectId)) {
  61. refresh();
  62. }
  63. throw "不退出";
  64. },
  65. });
  66. </script>
  67. <style lang="scss" scoped>
  68. .table-ctrl-right {
  69. .search-scene {
  70. margin: 0 20px 0 26px;
  71. }
  72. i {
  73. margin-left: 20px;
  74. font-size: 1.7rem;
  75. vertical-align: middle;
  76. cursor: pointer;
  77. &.active {
  78. color: var(--primaryColor);
  79. }
  80. }
  81. }
  82. .leave-from {
  83. // width: 520px;
  84. margin: 0 auto;
  85. }
  86. .title {
  87. font-weight: bold;
  88. color: #26559b;
  89. line-height: 19px;
  90. font-size: 14px;
  91. }
  92. .msg-content {
  93. overflow: hidden; //超出的文本隐藏
  94. text-overflow: ellipsis; //溢出用省略号显示
  95. white-space: nowrap; //溢出不换行
  96. position: relative;
  97. cursor: pointer;
  98. }
  99. </style>