uploadRecord.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view v-show="show">
  3. <view class="item" @click="openModel(item)" hover-class="navigator-hover" v-for="item in list" :key="item.rowindex">
  4. <view class="title">{{ item.createdate || ' --' }}</view>
  5. <view class="row u-line-3">
  6. {{ item.content }}
  7. </view>
  8. </view>
  9. <u-modal :show="modleShow" confirmText="复制" cancelText="关闭" :showCancelButton="true" @cancel="onCancel"
  10. @confirm="onConfirm">
  11. <template slot="default">
  12. <view>
  13. <view style="width: 100%;text-align: center;font-weight: bold;margin-bottom: 20px;">
  14. {{ modle.createdate }}
  15. </view>
  16. <view style="word-break: break-all;">
  17. {{ modle.content }}
  18. </view>
  19. </view>
  20. </template>
  21. </u-modal>
  22. </view>
  23. </template>
  24. <script>
  25. let paging = {}
  26. export default {
  27. name: "uploadRecord",
  28. props: {
  29. w_deviceid: String
  30. },
  31. data() {
  32. return {
  33. show: false,
  34. uninitialized: true,
  35. list: [],
  36. "where": {
  37. "begindate": "",
  38. "enddate": ""
  39. },
  40. modle: {},
  41. modleShow: false
  42. }
  43. },
  44. methods: {
  45. getList(init = false) {
  46. if (init) paging = {
  47. pageNumber: 1,
  48. pageTotal: 1,
  49. };
  50. return new Promise((resolve) => {
  51. if (paging.pageNumber > paging.pageTotal) return resolve()
  52. this.$Http.basic({
  53. "id": 20230701132202,
  54. "content": {
  55. "type": 1,
  56. "w_deviceid": this.w_deviceid,
  57. ...paging,
  58. "where": this.where
  59. }
  60. }).then(res => {
  61. console.log('上传记录', res)
  62. resolve(!this.cutoff(res.msg));
  63. if (this.cutoff(res.msg)) return;
  64. paging.pageNumber = res.pageNumber + 1;
  65. paging.pageTotal = res.pageTotal;
  66. this.list = res.pageNumber == 1 ? res.data : this.list.concat(res.data)
  67. })
  68. })
  69. },
  70. openModel(item) {
  71. this.modle = item;
  72. this.modleShow = true;
  73. },
  74. onCancel() {
  75. this.modleShow = false;
  76. },
  77. onConfirm() {
  78. let that = this;
  79. uni.setClipboardData({
  80. data: this.modle.content,
  81. complete: (res) => {
  82. console.log("复制", res)
  83. this.onCancel();
  84. },
  85. })
  86. }
  87. },
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .item {
  92. width: 355px;
  93. margin: 0 auto 10px;
  94. padding: 10px;
  95. background: #fff;
  96. border-radius: 4px;
  97. box-sizing: border-box;
  98. .title {
  99. line-height: 21px;
  100. font-size: 15px;
  101. font-family: PingFang SC-Medium, PingFang SC;
  102. font-weight: bold;
  103. color: #333333;
  104. margin-bottom: 10px;
  105. }
  106. .row {
  107. line-height: 17px;
  108. font-size: 12px;
  109. color: #666666;
  110. margin-bottom: 5px;
  111. }
  112. }
  113. /deep/.u-empty {
  114. z-index: 1 !important;
  115. }
  116. </style>