移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
3.2 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. :title="type"
  5. left-arrow
  6. @click-left="$router.back(-1)"
  7. />
  8. <p class="title">{{form.title}}</p>
  9. <van-row style="text-align: center;margin: 0.3rem 0;">
  10. <van-col span="2" :offset="1">
  11. <van-image
  12. width="24"
  13. height="24"
  14. src="../../../static/images/onlineHome/threeAffair1.png"
  15. style="margin-top: 5px;"
  16. />
  17. </van-col>
  18. <van-col span="20">
  19. <van-row>
  20. <van-col span="24" style="text-align: left;font-size: 10px;">{{form.createBy}}</van-col>
  21. </van-row>
  22. <van-row>
  23. <van-col span="24" style="text-align: left;font-size: 10px;">{{form.createTime}}</van-col>
  24. </van-row>
  25. </van-col>
  26. </van-row>
  27. <div id="content" style="padding: 0 10px"></div>
  28. <p style="margin-top:20px;padding: 0 10px">附件下载</p>
  29. <van-cell v-for="(item,index) in fileList" :key="index">
  30. <a :href="item.fileUrl">{{index+1}}.{{item.fileName}}</a>
  31. </van-cell>
  32. </div>
  33. </template>
  34. <script>
  35. import onlineHomeIndex from "../onlineHomeIndex";
  36. import {attachmentList, getAffairs, getVillageAffairs, listAffairs} from "../../api/onlineHome/threeAffairs";
  37. import request from '@/utils/request'
  38. export default {
  39. components: {
  40. },
  41. name: "villageAffairsDetail",
  42. data() {
  43. return {
  44. id:null,
  45. type:"",
  46. // 查询参数
  47. queryParams: {
  48. pageNum: 1,
  49. pageSize: 10,
  50. title: null,
  51. openType: null,
  52. deptId: null,
  53. isWechat: null,
  54. status: null,
  55. },
  56. form:{},
  57. fileList: [], //上传附件图片列表
  58. fileListData: [], //上传附件图片列表参数
  59. };
  60. },
  61. created() {
  62. console.log(this.$route.query.type)
  63. if(this.$route.query.type== "1"){
  64. this.type = "政策法规"
  65. }else if(this.$route.query.type== "2"){
  66. this.type = "惠农政策"
  67. }else if(this.$route.query.type== "3"){
  68. this.type = "工作动态"
  69. }else if(this.$route.query.type== "4"){
  70. this.type = "制度建设"
  71. }
  72. this.id = this.$route.query.id
  73. this.getDetail();
  74. },
  75. methods: {
  76. getDetail() {
  77. getVillageAffairs(this.id).then(response => {
  78. this.form = response.data
  79. document.getElementById('content').innerHTML = response.data.content;
  80. let params = {
  81. "fileType" : "0",
  82. "tableName":"t_village_affairs",
  83. "tableId":this.id,
  84. }
  85. attachmentList(params).then((res) => {
  86. console.log(res)
  87. res.rows.map(r => {
  88. r.fileUrl = location.protocol+"//"+location.host+request.defaults.baseURL+r.fileUrl
  89. this.fileList.push(r)
  90. })
  91. });
  92. })
  93. },
  94. },
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .app-container {
  99. padding-bottom: 0.5rem;
  100. height: 100vh;
  101. background-color: #fff;
  102. }
  103. .title{
  104. text-align: center;
  105. font-size: 0.6rem;
  106. }
  107. #content{
  108. overflow: hidden;
  109. }
  110. </style>