workscheme.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view class="" v-if="meetingPlanList.length">
  3. <view class="evolve" v-for="(item,index) in meetingPlanList" :key="index" @click="download(item.filePath)">
  4. <view class="evolve_img">
  5. <image :src="changeImg(item.filePath)" mode=""></image>
  6. </view>
  7. <view class="evolve_information">
  8. <view class="fileName">{{item.fileName}}</view>
  9. <view>上传时间:{{item.createDate.slice(0,9)}}</view>
  10. <view>上传人:{{meetingUserName[item.createBy]}}</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
  17. export default {
  18. props: ['meetingId'],
  19. data() {
  20. return {
  21. scrollTop: 0,
  22. meetingPlanList: {},
  23. meetingUserName: {},
  24. }
  25. },
  26. mounted() {
  27. this.getPlanList()
  28. },
  29. methods: {
  30. async getPlanList() {
  31. const res = await this.$myRequest({
  32. url: '/meeting/meetingPlan/findAppMeetingPlan',
  33. data: {
  34. meetingId: this.meetingId
  35. },
  36. });
  37. this.meetingPlanList = res.data.data
  38. this.meetingUserName = res.data.userNameMap
  39. // console.log(this.meetingPlanList.createBy)
  40. console.log(this.meetingUserName[1])
  41. // this.meetingPlanList.createDate = this.meetingPlanList[0].createDate.slice(0,9)
  42. },
  43. download(url) {
  44. console.log(url)
  45. uni.downloadFile({
  46. url: 'https://m.geidcp.com/api/file/pub/' + url,
  47. success: function(res) {
  48. var filePath = res.tempFilePath;
  49. uni.openDocument({
  50. filePath: filePath,
  51. success: function(res) {
  52. console.log('打开文档成功');
  53. }
  54. });
  55. }
  56. });
  57. console.log(url)
  58. },
  59. changeImg(src) {
  60. if (src.includes('pdf')) {
  61. return '../../static/img/conference/pdf.png'
  62. } else if (src.includes('doc')) {
  63. return '../../static/img/conference/doc.png'
  64. } else {
  65. return '../../static/img/conference/XLSX.png'
  66. }
  67. }
  68. },
  69. onLoad(option) {
  70. // this.meetingId = option.id
  71. this.getWorkList()
  72. this.changeImg()
  73. // this.getPlanList()
  74. }
  75. }
  76. </script>
  77. <style>
  78. page {
  79. background-color: #f2f2f2;
  80. /* padding-bottom: 100rpx; */
  81. }
  82. .evolve {
  83. width: 100%;
  84. height: 200rpx;
  85. margin-bottom: 10px;
  86. }
  87. .evolve_img {
  88. display: inline-block;
  89. width: 200rpx;
  90. height: 200rpx;
  91. /* border: 1px solid #000000; */
  92. border-radius: 12rpx;
  93. padding: 8rpx 18rpx 30rpx 40rpx;
  94. overflow: hidden;
  95. }
  96. .evolve_img image {
  97. width: 100%;
  98. height: 100%;
  99. }
  100. .evolve_information {
  101. display: inline-block;
  102. width: 440rpx;
  103. height: 100%;
  104. /* border: 1px solid #000000; */
  105. margin-left: 24rpx;
  106. overflow: hidden;
  107. }
  108. /* .evolve_information view{
  109. height: 100rpx;
  110. } */
  111. .fileName {
  112. font-size: 15px;
  113. font-weight: 700;
  114. color: #9d9d9d;
  115. overflow: hidden;
  116. height: 27px;
  117. text-overflow: ellipsis;
  118. white-space: nowrap;
  119. margin: 10rpx 0 20rpx 0;
  120. }
  121. </style>