增加接口联调

This commit is contained in:
xuli
2025-11-27 18:18:19 +08:00
parent 9b4ccd7811
commit c8ad7a076c
20 changed files with 1745 additions and 1380 deletions

View File

@@ -29,10 +29,10 @@
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
:up="upOption" :down="downOption" :fixed="false" class="scroll-h" :class="{'loading-scroll':cssFlag}">
<view class="white-bg">
<block v-if="list.length>0">
<block v-for="(obj, index) in list" :key="index">
<view class="r-title">{{ parseTime(obj.dateStr,'{y}-{m}-{d} 星期{a}')}}</view>
<view class="report-list" v-for="(item, index) in obj.list" :key="index" @click="handleDetail(item)">
<block v-if="list">
<block v-if="list.length>0">
<!-- <view class="r-title">{{ parseTime(obj.dateStr,'{y}-{m}-{d} 星期{a}')}}</view> -->
<view class="report-list" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
<view class="r-list" style="padding-bottom:0">
<view class="r-name">{{ item.taskName }}</view>
<view class="r-right">
@@ -54,32 +54,35 @@
</view>
<view class="r-list">
<view class="r-left">
<view class="r-l-left">开始时间<span class="r-gray">{{ item.planTime }}</span></view>
<view class="r-l-left">开始时间<span class="r-gray">{{ parseTime(item.planTime,'{y}-{m}-{d} {h}:{i}') }}</span></view>
<view class="r-l-right">任务时长<span class="r-gray">{{ item.workHour }}小时</span></view>
</view>
</view>
<view class="r-list">
<view class="r-left">
<view class="r-l-left">
完成进度<span class="r-gray"><span :class="{'r-red':item.count<item.total}">{{item.count}}</span>/{{item.total}}</span>
完成进度<span class="r-gray"><span :class="{'r-red':item.groupFinishNum<item.groupNum}">{{item.groupFinishNum}}</span>/{{item.groupNum}}</span>
</view>
<view class="r-l-right">完成比率<span class="r-blue">{{item.percentage}}</span></view>
<view class="r-l-right">完成比率<span class="r-blue">{{(item.groupFinishNum/item.groupNum).toFixed()+'%'}}</span></view>
</view>
</view>
<view class="r-list">
<view class="r-left">
<view>任务状态
<span class="r-gray" v-if="item.taskStatus==3">
<block v-if="item.count==0">待执行</block>
<block v-if="item.groupFinishNum==0">待执行</block>
<block v-else>执行中</block>
</span>
<span class="r-gray" v-else>{{formatTaskStatus(item.taskStatus) }}</span>
</view>
</view>
</view>
<view class="report-border" v-if="index<obj.list.length-1"></view>
<view class="report-border" v-if="index<list.length-1"></view>
</view>
</block>
<view v-else class="no-data">
<img :src="'static/images/polling/pic-NoResult.png'" class="no-pic" />
</view>
</block>
<view v-else class="no-data">
<img :src="'static/images/polling/pic-NoResult.png'" class="no-pic" />
@@ -101,7 +104,7 @@ import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import searchDate from '@/components/searchDate.vue';
import { parseTime,getDateRange,getDateRangeName } from '@/utils/datetime.js';
import { taskTypeOptions,formatTaskType,formatTaskStatus } from '@/utils/status.js';
import { noticeList } from '@/api/notice.js'
import { taskLists } from '@/api/polling.js'
const { proxy } = getCurrentInstance();
@@ -119,6 +122,9 @@ const dateConfirm=(dateObj)=>{
isShow.value = false;
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate;
dateStrName.value = getDateRangeName(dateObj.lastType)
form.value.startDate = dateObj.startDate;
form.value.endDate = dateObj.endDate
}
// 类型索引
@@ -134,6 +140,10 @@ onLoad(option => {
let dateObj = getDateRange('3days');
dateStr.value = dateObj.startDate + ' 至 '+dateObj.endDate;
dateStrName.value="近3天"
form.value.startDate = dateObj.startDate;
form.value.endDate = dateObj.endDate
})
@@ -147,7 +157,7 @@ const changeTaskType = (e)=>{
// 查询列表
let list = ref([]);
let form = ref({
beginTime:''
startDate:''
})
const mescrollRef = ref(null);
const upOption = ref({
@@ -213,75 +223,14 @@ const getList = (pageIndex, pageSize) => {
let param = {
pageIndex,
pageSize,
timeBegin: form.value.startDate,
timeEnd: form.value.endDate,
}
// let res = await noticeList(param);
let res = {
"code": 200,
"msg": "操作成功",
"data": {
list:[
{
dateStr:new Date().getTime(),
list:[
{
taskName:'日常巡检任务AAA日常巡检任务111',
taskId:202512297899,
taskStatus:3,
taskType:1,
planTime:'10:25',
workHour:1,
count:0,
total:70,
percentage:'30%'
},
{
taskName:'日常巡检任务AAA日常巡检任务222',
taskId:202512297899,
taskStatus:3,
taskType:2,
planTime:'10:25',
workHour:1,
count:20,
total:70,
percentage:'40%'
},
{
taskName:'日常巡检任务BBB任务名称过长时可折行 行距35px',
taskId:202512297899,
taskStatus:4,
taskType:1,
planTime:'10:25',
workHour:1,
count:70,
total:70,
percentage:'100%'
},
{
taskName:'日常巡检任务ccc任务名称',
taskId:202512297899,
taskStatus:5,
taskType:2,
planTime:'10:25',
workHour:1,
count:70,
total:70,
percentage:'100%'
},
],
},
],
recordCount:10,
}
}
let data = res.data||{};
let res = await taskLists(param);
let data = res ||{};
resolve({
...data,
total: res.recordCount || 0
// total: res.recordCount || 0
});
});
@@ -307,7 +256,7 @@ const handleDetail = (item,type) =>{
height: calc(100vh - 108px);
/* #endif */
/* #ifndef APP-PLUS */
height: calc(100vh - 130px);
height: calc(100vh - 135px);
/* #endif */
}
@@ -415,7 +364,7 @@ const handleDetail = (item,type) =>{
width:525rpx
}
.r-left .r-l-left{
width:350rpx;
width:370rpx;
}
.r-left .r-l-right{