2024-03-20 13:34:07 +08:00
|
|
|
<template>
|
|
|
|
|
<a-drawer
|
|
|
|
|
v-model:visible="visible"
|
|
|
|
|
class="task_page"
|
|
|
|
|
style="color: #000"
|
|
|
|
|
title="Task List"
|
|
|
|
|
placement="right"
|
|
|
|
|
@after-visible-change="afterVisibleChange"
|
|
|
|
|
>
|
2024-03-21 10:49:21 +08:00
|
|
|
<template #extra>
|
|
|
|
|
<div class="button_second" @click="openTaskDetailPage">Detailed Task</div>
|
|
|
|
|
</template>
|
2024-03-20 13:34:07 +08:00
|
|
|
<div class="task_content">
|
|
|
|
|
<div class="task_content_item" v-for="item in taskList">
|
2024-03-21 10:49:21 +08:00
|
|
|
<img v-if="item.state !== 'success'" src="@/assets/images/homePage/loading.gif" alt="">
|
|
|
|
|
<img v-else :src="item.inputParam.images" alt="">
|
|
|
|
|
<div class="task_content_item_text">
|
|
|
|
|
<div class="task_content_item_text_left modal_title_text">
|
|
|
|
|
<div class="task_content_item_text_left_titile">{{ item.title }}</div>
|
|
|
|
|
<div class="task_content_item_text_left_into modal_title_text_intro">{{ item.createDate }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="task_content_item_text_right modal_title_text">
|
|
|
|
|
<div class="task_content_item_text_left_titile">{{ item.status }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="task_content_more" v-show="taskListMore.length == 0" @click="setTaskListMore">
|
|
|
|
|
点击查看更多
|
|
|
|
|
</div>
|
|
|
|
|
<div class="task_content_select" v-show="taskListMore.length > 0">
|
|
|
|
|
<a-select :visibleChange="visibleChange()" v-model:value="currentState.value" size="large" optionFilterProp="label" :options="state" placeholder="Please select" :getPopupContainer="getPopupContainer" allowClear show-search></a-select>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="task_content_item" v-for="item in taskListMore" v-show="taskListMore.length > 0">
|
2024-03-20 13:34:07 +08:00
|
|
|
<img v-if="item.state === '执行中' || item.state === '失败'" src="@/assets/images/homePage/loading.gif" alt="">
|
|
|
|
|
<img v-else :src="item.url" alt="">
|
|
|
|
|
<div class="task_content_item_text">
|
|
|
|
|
<div class="task_content_item_text_left modal_title_text">
|
|
|
|
|
<div class="task_content_item_text_left_titile">{{ item.title }}</div>
|
|
|
|
|
<div class="task_content_item_text_left_into modal_title_text_intro">{{ item.time }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="task_content_item_text_right modal_title_text">
|
|
|
|
|
<div class="task_content_item_text_left_titile">{{ item.state }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-21 10:49:21 +08:00
|
|
|
<div v-show="total > taskListMore?.length && total != 0 && taskListMore.length > 0" class="task_content_more" v-observe>
|
|
|
|
|
<img src="@/assets/images/homePage/loading.gif" alt="">
|
2024-03-20 13:34:07 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2024-03-21 10:49:21 +08:00
|
|
|
<TaskDetailPage ref="TaskDetailPage"></TaskDetailPage>
|
2024-03-20 13:34:07 +08:00
|
|
|
</a-drawer>
|
|
|
|
|
</template>
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { message, Upload } from "ant-design-vue";
|
|
|
|
|
import { defineComponent, computed, h, ref, nextTick, inject } from "vue";
|
|
|
|
|
import { Https } from "@/tool/https";
|
|
|
|
|
import { useStore } from "vuex";
|
|
|
|
|
// import { forEach } from "jszip";
|
2024-03-21 10:49:21 +08:00
|
|
|
import TaskDetailPage from "@/component/HomePage/TaskDetailPage.vue";
|
2024-03-20 13:34:07 +08:00
|
|
|
export default defineComponent({
|
|
|
|
|
components: {
|
2024-03-21 10:49:21 +08:00
|
|
|
TaskDetailPage,
|
2024-03-20 13:34:07 +08:00
|
|
|
},
|
|
|
|
|
props: ["msg",'sketchCatecoryList'],
|
|
|
|
|
setup() {
|
|
|
|
|
// console.log(prop.msg);
|
|
|
|
|
const store = useStore();
|
|
|
|
|
let visible = ref<boolean>(false);
|
|
|
|
|
let taskList = ref([
|
2024-03-21 10:49:21 +08:00
|
|
|
|
|
|
|
|
])
|
|
|
|
|
let taskListMore:any = ref([])
|
|
|
|
|
let state:any = ref([
|
2024-03-20 13:34:07 +08:00
|
|
|
{
|
2024-03-21 10:49:21 +08:00
|
|
|
label:'Income',
|
|
|
|
|
value:'income',
|
2024-03-20 13:34:07 +08:00
|
|
|
},
|
2024-03-21 10:49:21 +08:00
|
|
|
{
|
|
|
|
|
label:'Expend',
|
|
|
|
|
value:'expend',
|
|
|
|
|
}
|
2024-03-20 13:34:07 +08:00
|
|
|
])
|
2024-03-21 10:49:21 +08:00
|
|
|
let currentState = ref({
|
|
|
|
|
value:'income',
|
|
|
|
|
})
|
2024-03-20 13:34:07 +08:00
|
|
|
return {
|
|
|
|
|
store,
|
|
|
|
|
visible,
|
|
|
|
|
taskList,
|
2024-03-21 10:49:21 +08:00
|
|
|
taskListMore,
|
|
|
|
|
state,
|
|
|
|
|
currentState,
|
2024-03-20 13:34:07 +08:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
data(prop) {
|
|
|
|
|
return {
|
2024-03-21 10:49:21 +08:00
|
|
|
currentPage: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
total: 99,
|
2024-03-20 13:34:07 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
},
|
2024-03-21 10:49:21 +08:00
|
|
|
directives:{
|
|
|
|
|
observe:{
|
|
|
|
|
mounted (el,binding) {
|
|
|
|
|
// console.log(binding.instance);
|
|
|
|
|
const ob = new IntersectionObserver(callback,{
|
|
|
|
|
root:null,
|
|
|
|
|
threshold:[0.1]
|
|
|
|
|
})
|
|
|
|
|
ob.observe(el)
|
|
|
|
|
// this.currentPage = 1
|
|
|
|
|
// this.pageSize = 12
|
|
|
|
|
let this_:any = binding.instance
|
|
|
|
|
function callback(entries:any, observer:any) {
|
|
|
|
|
entries.forEach((entry:any) => {
|
|
|
|
|
if (entry.isIntersecting) {
|
|
|
|
|
this_.getTaskList()
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-03-20 13:34:07 +08:00
|
|
|
watch:{
|
|
|
|
|
// newWindowState:{
|
|
|
|
|
// handler(newVal,oldVal){
|
|
|
|
|
// console.log(newVal);
|
|
|
|
|
// if(newVal){
|
|
|
|
|
// this.newWindow?.close();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-03-21 10:49:21 +08:00
|
|
|
getPopupContainer(){
|
|
|
|
|
let dom = document.querySelector('.task_page .task_content_select')
|
|
|
|
|
return dom
|
|
|
|
|
},
|
2024-03-20 13:34:07 +08:00
|
|
|
init(){
|
|
|
|
|
this.visible = true
|
2024-03-21 10:49:21 +08:00
|
|
|
Https.axiosGet(Https.httpUrls.getTasksList).then((rv)=>{
|
|
|
|
|
|
|
|
|
|
this.taskList = this.sort(rv)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
sort(arr:any){
|
|
|
|
|
arr.sort((a:any, b:any) => {
|
|
|
|
|
var a_num = Date.parse(a.createDate);
|
|
|
|
|
var b_num = b.style.zIndex;
|
|
|
|
|
return a_num - b_num;
|
|
|
|
|
});
|
|
|
|
|
return arr
|
2024-03-20 13:34:07 +08:00
|
|
|
},
|
|
|
|
|
afterVisibleChange(bool:any){
|
2024-03-21 10:49:21 +08:00
|
|
|
if(!bool){
|
|
|
|
|
this.taskListMore = []
|
|
|
|
|
}
|
2024-03-20 13:34:07 +08:00
|
|
|
console.log(bool);
|
2024-03-21 10:49:21 +08:00
|
|
|
},
|
|
|
|
|
setTaskListMore(){
|
|
|
|
|
// this.taskListMore = this.taskList
|
|
|
|
|
|
|
|
|
|
this.taskListMore.push(...this.taskList,...this.taskList)
|
|
|
|
|
},
|
|
|
|
|
openTaskDetailPage(){
|
|
|
|
|
let taskDetailPage:any = this.$refs.TaskDetailPage
|
|
|
|
|
this.visible = false
|
|
|
|
|
taskDetailPage.init()
|
|
|
|
|
},
|
|
|
|
|
visibleChange(){
|
|
|
|
|
this.pageSize = 10
|
|
|
|
|
this.currentPage = 1
|
|
|
|
|
this.total = 0
|
|
|
|
|
},
|
|
|
|
|
getTaskList(){
|
|
|
|
|
let data = {
|
|
|
|
|
size:this.pageSize,
|
|
|
|
|
page: this.currentPage,
|
|
|
|
|
aaa:this.currentState,
|
|
|
|
|
}
|
|
|
|
|
console.log(123123);
|
|
|
|
|
this.currentPage += 1
|
|
|
|
|
Https.axiosGet()
|
2024-03-20 13:34:07 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.task_page {
|
|
|
|
|
.ant-drawer-body{
|
|
|
|
|
background: #f6f5fa;
|
|
|
|
|
}
|
|
|
|
|
.task_content{
|
|
|
|
|
.task_content_item{
|
|
|
|
|
background: #fff;
|
|
|
|
|
margin: 2rem 0;
|
|
|
|
|
padding: 1rem 2rem 1rem 1rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
position: relative;
|
|
|
|
|
height: 12rem;
|
|
|
|
|
border-radius: 1rem;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
img{
|
|
|
|
|
width: 10rem;
|
|
|
|
|
max-height: 100%;
|
|
|
|
|
object-fit: contain;
|
|
|
|
|
margin-right: 2rem;
|
|
|
|
|
}
|
|
|
|
|
.task_content_item_text{
|
|
|
|
|
|
|
|
|
|
// display: flex;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
flex: 1;
|
|
|
|
|
height: 100%;
|
|
|
|
|
align-items: center;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
position: relative;
|
|
|
|
|
.task_content_item_text_left,.task_content_item_text_right{
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
.task_content_item_text_left{
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
margin-right: 2rem;
|
|
|
|
|
div{
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
white-space: nowrap; /* 禁止换行 */
|
|
|
|
|
text-overflow: ellipsis; /* 显示省略号 */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.task_content_item_text_right{
|
|
|
|
|
width: 10rem;
|
|
|
|
|
.task_content_item_text_left_titile,.task_content_item_text_left_into{
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
.text_click{
|
|
|
|
|
}
|
|
|
|
|
.task_content_item_text_left_into{
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: .3s all;
|
|
|
|
|
opacity: 0;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.task_content_item:hover .task_content_item_text_left_into{
|
|
|
|
|
opacity: 1 !important;
|
|
|
|
|
}
|
|
|
|
|
.task_content_more{
|
|
|
|
|
background: #fff;
|
|
|
|
|
width: 100%;
|
|
|
|
|
line-height: 5rem;
|
|
|
|
|
text-align: center;
|
|
|
|
|
cursor: pointer;
|
2024-03-21 10:49:21 +08:00
|
|
|
img{
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 5rem;
|
|
|
|
|
object-fit: contain;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.task_content_select{
|
|
|
|
|
>div{
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
2024-03-20 13:34:07 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
<style lang="less">
|
|
|
|
|
.task_page,.layout_modal{
|
|
|
|
|
}
|
|
|
|
|
</style>
|