offLine.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!-- 离线资料 -->
  2. <template>
  3. <scroll-view scroll-y class="DrawerPage" >
  4. <cu-custom bgColor="bg-blue" :isBack="true">
  5. <block slot="backText">离线文件</block>
  6. <block slot="content"></block>
  7. <block slot="right">
  8. <view class=" flex justify-center">
  9. <!-- <button class="margin-top-ssm cu-btn round bg-blue text-blue"><text class="cuIcon-add"></text></button> -->
  10. </view>
  11. </block>
  12. </cu-custom>
  13. <!-- 内容 -->
  14. <view class="cu-card article no-card ">
  15. <view class="cu-item shadow solid-bottom-type" style="padding-bottom: 0px;" v-for="item in data" :key="item.data.nodeId">
  16. <view class="cu-item_1">
  17. <!-- <image class="cu-item_img" src="/static/task/noTask.png"></image> -->
  18. <view class="cu-item_right">
  19. <view class="cu-item_name">
  20. [{{item.data.fileName}}]
  21. </view>
  22. <view class="cu-item_timer margin-top">
  23. {{item.data.name}}
  24. </view>
  25. </view>
  26. </view>
  27. <view class="cu-item_2">
  28. <text class="cu-item_timer">{{item.createTime}} </text>
  29. <view class="cu-item_button">
  30. <button class="bg-blue" @click="navTo(item.data)">编辑</button>
  31. <!-- <button class="bg-yellow" @click="navTo(item)">导入填报</button> -->
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view v-if="data.length!=0" style="padding: 60rpx 0 120rpx;text-align: center;font-size: 26rpx;color: #AEAEAE;">没有更多内容了~</view>
  37. <view v-else style="padding: 60rpx 0 120rpx;text-align: center;font-size: 26rpx;color: #AEAEAE;">暂时没有离线文件~</view>
  38. </scroll-view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. userId:"",
  45. data:[],
  46. }
  47. },
  48. onLoad() {
  49. this.userId=uni.getStorageSync("userInfo").id;
  50. },
  51. onShow() {
  52. this.findFile();
  53. },
  54. /* 监听头部搜索框 */
  55. onNavigationBarSearchInputChanged(e) {
  56. console.log("输入的信息为:"+e.text)
  57. },
  58. methods: {
  59. navTo(data){
  60. var that =this;
  61. /* console.log(data);return; */
  62. uni.navigateTo({
  63. url:"/pages/personBaseIndex/OfflineReport/OfflineReport?processId="+data.nodeId
  64. })
  65. },
  66. findFile(){
  67. var that =this;
  68. that.http.request("/app/OfflineFile",{userId:that.userId}).then(res=>{
  69. that.data=res.datas;
  70. that.data.forEach(item=>{
  71. var name = item.data.name.split("/");
  72. item.data.fileName =name[name.length-2]+"/"+name[name.length-1];
  73. })
  74. console.log(that.data)
  75. })
  76. }
  77. },
  78. filters: {
  79. timeStamp: function(value) {
  80. if (!value) return '';
  81. var now = new Date(value);
  82. var year = now.getFullYear();
  83. var month = now.getMonth() + 1;
  84. var hour = now.getHours() >=10 ? now.getHours() : "0"+now.getHours() ;
  85. var minutes = now.getMinutes() >=10 ? now.getMinutes() : "0"+now.getMinutes();
  86. var time = hour+":"+minutes;
  87. if (month < 10) {
  88. month = '0' + month
  89. }
  90. var date = now.getDate();
  91. if (date < 10) {
  92. date = '0' + date
  93. }
  94. return year + "-" + month + "-" + date +" "+time
  95. }
  96. }
  97. }
  98. </script>
  99. <style>
  100. page{
  101. background-color: white;
  102. }
  103. .solid-bottom-type{
  104. border-bottom: 2rpx solid #eee;
  105. }
  106. .menuImageTask{
  107. height: 70rpx;
  108. width: 100rpx;
  109. }
  110. .cu-btn.lg {
  111. padding: 0 17px;
  112. font-size: 13px;
  113. height: 30px;
  114. }
  115. .text-black{
  116. color:#101010;
  117. }
  118. .cu-item_1{display: flex;padding: 28rpx 24rpx;}
  119. .cu-item_img{width: 140rpx;height: 140rpx;margin-right: 22rpx;}
  120. .cu-item_right{width: 100%;}
  121. .cu-item_name{font-size: 30rpx;color: #101010;overflow: hidden;text-overflow: ellipsis; -o-text-overflow: ellipsis;white-space:nowrap;}
  122. .cu-item_tex{font-size: 26rpx;color: #101010;margin-top: 16rpx;}
  123. .cu-item_2{display: flex;justify-content: space-between;align-items: center;padding: 0rpx 24rpx 22rpx;}
  124. .cu-item_timer{
  125. font-size: 30rpx;
  126. color: #8A8A8A;
  127. overflow:hidden;
  128. text-overflow:ellipsis;
  129. display:-webkit-box;
  130. -webkit-box-orient:vertical;
  131. -webkit-line-clamp:2;
  132. }
  133. .cu-item_button {display: flex;}
  134. .cu-item_button button{width: 140rpx;height: 60rpx;padding: 0;font-size: 24rpx;color: #fff;border-radius: 60rpx;margin-left: 20rpx;}
  135. </style>