DetailPage.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <el-dialog
  3. v-if="visible"
  4. title=""
  5. :visible.sync="visible"
  6. width="1200px"
  7. >
  8. <el-row :gutter="16">
  9. <el-col :span="12">网站名称:{{ rowData.siteName }}</el-col>
  10. <el-col :span="12">监控舆论词:{{ rowData.keywords }}</el-col>
  11. </el-row>
  12. <el-row :gutter="16">
  13. <el-col :span="12">监控域名:{{ rowData.domain }}</el-col>
  14. <el-col :span="12">
  15. 启动地址:
  16. <el-tag v-for="tag in rowData.startUrls" :key="tag"> {{ tag }}</el-tag>
  17. </el-col>
  18. </el-row>
  19. <el-table
  20. v-loading="isLoading"
  21. :data="pageData.records"
  22. border
  23. fit
  24. highlight-current-row
  25. >
  26. <el-table-column label="标题" prop="title" />
  27. <el-table-column label="网址" prop="url" />
  28. <el-table-column label="采集时间" prop="spiderTime" :formatter="dateTimeFormatter" width="200" />
  29. <el-table-column label="详情" width="70">
  30. <template slot-scope="scope">
  31. <a :href="scope.row.url" target="_blank">详情</a>
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. <el-pagination
  36. class="pagination-container"
  37. background
  38. layout="prev, pager, next"
  39. :total="pageData.total"
  40. :page-size="pageData.pageSize"
  41. @current-change="paginationChange"
  42. />
  43. <div slot="footer" class="dialog-footer">
  44. <el-button @click="visible = false">取 消</el-button>
  45. </div>
  46. </el-dialog>
  47. </template>
  48. <script>
  49. import { findDetailPage } from '@/api/statistics/popular_feelings'
  50. import { dateTimeFormatter } from '@/utils/formater'
  51. export default {
  52. components: {},
  53. data() {
  54. return {
  55. visible: false,
  56. isLoading: false,
  57. rowData: false,
  58. pageData: {},
  59. currentPage: 1
  60. }
  61. },
  62. mounted() {
  63. },
  64. methods: {
  65. dateTimeFormatter,
  66. open(rowData) {
  67. this.rowData = rowData
  68. this.visible = true
  69. this.isLoading = false
  70. console.log(this.rowData)
  71. this.fetchData()
  72. },
  73. paginationChange(val) {
  74. this.currentPage = val
  75. this.fetchData()
  76. },
  77. fetchData() {
  78. this.isLoading = true
  79. findDetailPage({ ...this.queryForm, current: this.currentPage, popularFeelingsId: this.rowData.id })
  80. .then((response) => {
  81. this.pageData = response
  82. })
  83. .finally(() => (this.isLoading = false))
  84. }
  85. }
  86. }
  87. </script>