message.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!--消息-->
  2. <template>
  3. <div class="app-container manageInformation">
  4. <div class="top-title-box">
  5. <p class="color_one">消息</p>
  6. <i class="right-top-button el-icon-close" @click="backPage"></i>
  7. </div>
  8. <div class="table-box">
  9. <el-table v-loading="loading" border :data="hardwareList" @selection-change="handleSelectionChange">
  10. <el-table-column label="发送人" align="left" prop="sendName" width="200"/>
  11. <el-table-column label="发送时间" align="left" prop="createTime" width="270"/>
  12. <el-table-column label="发送内容" align="left" prop="meaasgeContext">
  13. <template slot-scope="scope">
  14. <el-collapse v-if="scope.row.meaasgeContext.length>70">
  15. <el-collapse-item title="点击查看">
  16. <div v-html="scope.row.meaasgeContext"></div>
  17. </el-collapse-item>
  18. </el-collapse>
  19. <span v-else>{{scope.row.meaasgeContext}}</span>
  20. </template>
  21. </el-table-column>
  22. </el-table>
  23. <pagination :page-sizes="[20, 30, 40, 50]"
  24. v-show="total>0"
  25. :total="total"
  26. layout="total, prev, pager, next, sizes, jumper"
  27. :page.sync="queryParams.pageNum"
  28. :limit.sync="queryParams.pageSize"
  29. @pagination="getList"
  30. />
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { myAlllistContent } from "@/api/laboratory/content";
  36. export default {
  37. props:{
  38. videoData:[],
  39. },
  40. name: 'manageInformation',
  41. data() {
  42. return {
  43. // 遮罩层
  44. loading: false,
  45. // 查询参数
  46. queryParams: {
  47. pageNum: 1,
  48. pageSize:20,
  49. },
  50. // 总条数
  51. total: 1,
  52. // 表格数据
  53. hardwareList: [],
  54. demoTex:"点击查看"
  55. }
  56. },
  57. created() {
  58. this.hardwareList = this.getList();
  59. },
  60. mounted(){
  61. },
  62. methods: {
  63. backPage(){
  64. this.$parent.pageSwitchOff();
  65. },
  66. // 多选框选中数据
  67. handleSelectionChange(selection) {
  68. this.ids = selection.map(item => item.id)
  69. this.single = selection.length!==1
  70. this.multiple = !selection.length
  71. },
  72. /** 查询列表 */
  73. getList() {
  74. // this.loading = false;
  75. this.loading = true;
  76. myAlllistContent(this.queryParams).then(response => {
  77. this.hardwareList = response.rows;
  78. for(let i=0;i<this.hardwareList.length;i++){
  79. this.hardwareList[i].collapseType = false;
  80. this.hardwareList[i].meaasgeContext = unescape(this.hardwareList[i].meaasgeContext);
  81. }
  82. this.total = response.total;
  83. this.loading = false;
  84. });
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .manageInformation{
  91. flex:1;
  92. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  93. margin:20px 20px;
  94. position: relative;
  95. border-radius: 10px;
  96. display: flex;
  97. flex-direction: column;
  98. p{
  99. margin:0;
  100. }
  101. .top-title-box{
  102. border-bottom: 1px solid #E0E0E0;
  103. position: relative;
  104. .color_one{
  105. line-height:60px;
  106. padding-left:20px;
  107. }
  108. .right-top-button{
  109. height:30px;
  110. width:30px;
  111. font-size:20px;
  112. line-height:30px;
  113. text-align: center;
  114. color:#999;
  115. border-radius:50%;
  116. position: absolute;
  117. top:10px;
  118. right:10px;
  119. }
  120. .right-top-button:hover{
  121. background: #999;
  122. color:#fff;
  123. cursor:pointer;
  124. }
  125. }
  126. .table-box{
  127. overflow: hidden;
  128. padding:20px;
  129. flex:1;
  130. display: flex;
  131. flex-direction: column;
  132. }
  133. }
  134. </style>