123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- <template>
- <view class="">
- <view @tap.stop="toDetailFn(v.id)" class="list" v-for="(v, i) in dataList" :key="i">
- <text class="font">{{ v.updateTime }}</text>
- <view class="list_content">
- <view class="font_style">
- <view class="font_style_left"> 文件标题: </view>
- <view class="font_style_right">
- {{ v.title }}
- </view>
- </view>
- <view class="font_style">
- <view class="font_style_left"> 创建时间: </view>
- <view class="font_style_right">
- {{ v.createTime }}
- </view>
- </view>
- <view class="font_style">
- <view class="font_style_left"> 备注: </view>
- <view class="font_style_right">
- {{ v.remark }}
- </view>
- </view>
- </view>
- </view>
- <Loading :loadStatus="loadStatus" :dataList="dataList" />
- </view>
- </template>
- <script>
- import { mapState } from 'vuex'
- import { getUserInfo } from '@/common/utils/util'
- export default {
- data() {
- return {
- pageNum: 1,
- pageSize: 20,
- remark: '',
- status: true,
- title: '',
- dataList: [],
- loadStatus: 0
- }
- },
- async onPullDownRefresh() {
- this.pageNum = 1
- await this.getData()
- uni.stopPullDownRefresh()
- },
- async onReachBottom() {
- this.pageNum++
- await this.getData()
- },
- computed: {
- ...mapState(['userInfo', 'isLogin', 'userId'])
- },
- mounted() {
- this.getData()
- },
- methods: {
- //跳转页面
- toDetailFn(id) {
- this.$navToPage({
- url: `/packageMine/pages/coreLssuedFile/detail?id=${id}`
- })
- },
- //获取数据
- async getData() {
- this.loadStatus = 1
- this.$api
- .get('/worker/comlist/list', {
- pageNum: this.pageNum,
- pageSize: this.pageSize,
- remark: this.remark,
- status: this.status,
- title: this.title,
- workerNumber: (await getUserInfo())?.workerNumber
- })
- .then(res => {
- if (this.pageNum == 1) {
- this.dataList = res.data.records
- } else if (this.pageNum > 1) {
- this.dataList.push(...res.data.records)
- if (res.data.records.length == 0) {
- this.pageNum--
- }
- }
- this.loadStatus = 2
- return res.data.records
- })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .page {
- padding: 0 34rpx;
- }
- .list {
- margin: 0 32rpx;
- font-size: 28rpx;
- .list_content {
- background-color: #fff;
- padding: 20rpx;
- border-radius: 20rpx;
- }
- }
- .font_style {
- display: flex;
- color: #101010;
- line-height: 45rpx;
- .font_style_right {
- flex: 1;
- }
- .font_style_left {
- width: 145rpx;
- }
- .status {
- color: #00be8d;
- }
- }
- .font {
- display: block;
- color: #909090;
- padding: 20rpx 0;
- }
- </style>
|