OfficeApp/pages/oaTask/oaTask.vue

133 lines
3.0 KiB
Vue
Raw Permalink Normal View History

2023-07-15 17:51:20 +08:00
<template>
2023-11-07 09:21:19 +08:00
<view class="all_box">
<block v-if="skeleton">
<u-skeleton :loading="skeleton" :animate="true" title rows="2" rows-width="100%" rowsHeight="40"
v-for="i in 3" :key="i" style="padding: 28rpx;">
</u-skeleton>
</block>
<block v-else>
2023-11-10 16:59:01 +08:00
<u-tabs style="background-color: #0022C7;" :list="tabLists" @click="changeTypeCurrent" lineColor='white'
lineWidth='30' inactiveStyle='color:white' activeStyle="color:white"></u-tabs>
2023-11-07 09:21:19 +08:00
<u-empty v-if="list.length==0" icon="/static/img/empty/data.png" text="没有任务"></u-empty>
2023-11-10 16:59:01 +08:00
2023-11-07 09:21:19 +08:00
<view v-else class="task_list">
2023-11-10 16:59:01 +08:00
2023-11-07 09:21:19 +08:00
<!-- <taskCard class="task_card" v-for="item in 10" :key="item"></taskCard> -->
2023-11-10 16:59:01 +08:00
<view class="" v-if="baseList.length">
2023-11-17 18:15:12 +08:00
<task-item :datas="item" :taskValueList='taskValueList' v-for="item in baseList"
:key="item.id"></task-item>
2023-11-10 16:59:01 +08:00
</view>
<view class="" v-else>
<u-empty icon="/static/img/empty/data.png" text="没有任务"></u-empty>
</view>
2023-11-07 09:21:19 +08:00
</view>
</block>
<!-- <u-loadmore v-else :status="loadConfig.status" :loading-text="loadConfig.loadingText"
2023-08-05 12:02:12 +08:00
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" /> -->
2023-11-07 09:21:19 +08:00
</view>
2023-07-15 17:51:20 +08:00
</template>
<script>
2023-11-07 09:21:19 +08:00
import {
getTaskListApi
} from '@/api/oa'
import {
Toast
} from '@/libs/uniApi.js'
import taskItem from "@/components/task/taskItem.vue"
import {
taskLists
} from "@/api/task.js"
2023-11-17 18:15:12 +08:00
import {
dictDataListsTypeValue
} from "@/api/oaPbulic.js"
2023-11-07 09:21:19 +08:00
export default {
components: {
taskItem
},
data() {
return {
2023-11-10 16:59:01 +08:00
status: 2,
2023-11-07 09:21:19 +08:00
skeleton: false,
2023-11-10 16:59:01 +08:00
baseList: [],
tabLists: [{
name: '进行中',
id: 2
}, {
name: '已完成',
id: 3
}, ],
2023-11-07 09:21:19 +08:00
loadConfig: {
page: 1,
limit: 15,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
nomoreText: '我也是有底线的~~',
status: 'loadmore'
},
2023-11-17 18:15:12 +08:00
list: [],
taskValueList: [],
2023-11-07 09:21:19 +08:00
}
},
onLoad() {
this.skeleton = true;
2023-11-17 18:15:12 +08:00
2023-11-07 09:21:19 +08:00
},
onShow() {
this.loadList();
2023-11-17 19:08:23 +08:00
// this.getTaskValue()
2023-11-07 09:21:19 +08:00
},
onReady() {
uni.$on('initOaTask', this.loadList);
},
methods: {
2023-11-17 19:08:23 +08:00
// async getTaskValue() {
// const desiredElement = this.roleList.find(element => element.id == this.$store.state.app.userInfo
// .group_id);
// let res = await dictDataListsTypeValue({
// type_value: desiredElement.type_vale
// })
// this.taskValueList = res.data
// },
2023-11-10 16:59:01 +08:00
changeTypeCurrent(e) {
this.baseList = []
this.status = e.id
this.baseList = this.list.filter(item => item.status == this.status)
},
2023-11-07 09:21:19 +08:00
async loadList() {
let res = await taskLists({
limit: 15,
page: 1
});
this.list = res.data;
2023-11-10 16:59:01 +08:00
this.baseList = this.list.filter(item => item.status == this.status)
2023-11-07 09:21:19 +08:00
this.skeleton = false;
}
},
onPullDownRefresh() {
this.loadList();
this.$u.sleep(500).then(() => {
uni.stopPullDownRefresh()
});
},
onReachBottom() {},
}
2023-07-15 17:51:20 +08:00
</script>
<style lang="scss" scoped>
2023-11-07 09:21:19 +08:00
.task_list {
padding-top: 28rpx;
}
.loading {
padding: 28rpx;
margin-top: 28rpx;
}
</style>