增加接口联调

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

@@ -34,9 +34,9 @@
:up="upOption" :down="downOption" :fixed="false" class="scroll-h" :class="{'loading-scroll':cssFlag}">
<view class="white-bg" :class="{'bg-height':list.length<8}">
<block v-if="list.length>0">
<view class="report-list" v-for="(item, index) in list" :key="index" @click="handleDetail(item,2)">
<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.problemDesc }}</view>
<view class="r-name">{{ item.groupName }}</view>
<view class="r-right">
<!-- 问题状态 1=追踪2=关闭 -->
<view v-if="item.problemStatus==1" class="btn-red">进行中</view>
@@ -45,8 +45,8 @@
</view>
<view class="r-list">
<view class="r-left">
<view class="r-l-left" style="width:220rpx">跟踪次数<span class="r-gray">{{ item.count }}</span></view>
<view class="r-l-right">最近跟踪时间<span class="r-gray">{{parseTime(item.modifyTime,'{m}-{d} {h}:{i}') }}</span></view>
<view class="r-l-left" style="width:220rpx">跟踪次数<span class="r-gray">{{ item.logNum }}</span></view>
<view class="r-l-right">最近跟踪时间<span class="r-gray">{{parseTime(item.lastLogTime,'{m}-{d} {h}:{i}') }}</span></view>
</view>
</view>
<view class="report-border" v-if="index<list.length-1"></view>
@@ -70,6 +70,7 @@ import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import { getNavBarPaddingTop } from '@/utils/system.js'
import { noticeList } from '@/api/notice.js'
import { parseTime } from '@/utils/datetime.js'
import { problemList } from '@/api/polling.js'
onLoad(async(opt) => {
uni.setStorageSync('page_cache',true);
@@ -149,7 +150,7 @@ const mescrollInit = (mescroll) => {
const downCallback = async (mescroll) => {
try {
console.log("下拉刷新")
const res = await getNoticeList(1, upOption.value.page.size);
const res = await getList(1, upOption.value.page.size);
cssFlag.value = false;
list.value = res.list;
mescroll.resetUpScroll();
@@ -165,7 +166,7 @@ const downCallback = async (mescroll) => {
const upCallback = async (mescroll) => {
try {
console.log("上拉加载更多")
let res = await getNoticeList(mescroll.num, mescroll.size);
let res = await getList(mescroll.num, mescroll.size);
if (mescroll.num === 1) {
list.value = res.list;
} else {
@@ -178,95 +179,95 @@ const upCallback = async (mescroll) => {
}
// 获取数据列表
const getNoticeList = (pageIndex, pageSize) => {
const getList = (pageIndex, pageSize) => {
return new Promise(async (resolve) => {
let param = {
pageIndex,
pageSize,
searchValue:searchText.value?searchText.value:undefined,
key:searchText.value?searchText.value:undefined,
taskType:notictTypeCheck.value.id
}
// let res = await noticeList(param);
let res={
"code": 200,
"msg": "操作成功",
"data": {
list:[
{
problemDesc:'西区地下车库入口防汛物资摆放',
problemId:202512297899,
problemStatus:1,
modifyTime:new Date().getTime(),
count:0,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
},
{
problemDesc:'西区地下车库入口防汛物资摆放',
problemId:202512297899,
problemStatus:1,
modifyTime:new Date().getTime(),
count:0,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
},{
problemDesc:'西区地下车库入口防汛物资摆放',
problemId:202512297899,
problemStatus:1,
modifyTime:new Date().getTime(),
count:0,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
},
{
problemDesc:'监控室消防设备阀门确保正常开启闭合',
problemId:202512297899,
problemStatus:2,
modifyTime:new Date().getTime(),
count:20,
}
],
recordCount:2
}
}
let res = await problemList(param);
// let res={
// "code": 200,
// "msg": "操作成功",
// "data": {
// list:[
// {
// problemDesc:'西区地下车库入口防汛物资摆放',
// problemId:202512297899,
// problemStatus:1,
// modifyTime:new Date().getTime(),
// count:0,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// },
// {
// problemDesc:'西区地下车库入口防汛物资摆放',
// problemId:202512297899,
// problemStatus:1,
// modifyTime:new Date().getTime(),
// count:0,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// },{
// problemDesc:'西区地下车库入口防汛物资摆放',
// problemId:202512297899,
// problemStatus:1,
// modifyTime:new Date().getTime(),
// count:0,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// },
// {
// problemDesc:'监控室消防设备阀门确保正常开启闭合',
// problemId:202512297899,
// problemStatus:2,
// modifyTime:new Date().getTime(),
// count:20,
// }
// ],
// recordCount:2
// }
// }
let list = res.data.list || [];
let list = res.list || [];
resolve({
list,
@@ -277,8 +278,8 @@ const getNoticeList = (pageIndex, pageSize) => {
}
// 查看详情
const handleDetail = (item,type) =>{
let url= '/pages/business/polling/problemDetail?id='+item.taskId;
const handleDetail = (item) =>{
let url= '/pages/business/polling/problemDetail?problemId='+item.problemId;
uni.navigateTo({
url
});