巡检
This commit is contained in:
17
src/api/polling.js
Normal file
17
src/api/polling.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import request from "@/utils/request"
|
||||
|
||||
// 查询今日任务列表
|
||||
export function taskTodayList(data) {
|
||||
return request.post({
|
||||
url: '/acc/message/notify/detail',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询任务详情
|
||||
export function taskDetail(data) {
|
||||
return request.post({
|
||||
url: '/acc/message/notify/detail',
|
||||
data
|
||||
})
|
||||
}
|
||||
@@ -150,7 +150,7 @@ const handleRemove = (index) => {
|
||||
};
|
||||
// 点击组件某一项
|
||||
const handleChange = (index, item) => {
|
||||
console.log("选中了某一项", index, item);
|
||||
// console.log("选中了某一项", index, item);
|
||||
// 如果是单选框,选中一项后直接关闭
|
||||
if (!props.multiple) {
|
||||
console.log("关闭下拉框");
|
||||
|
||||
@@ -16,9 +16,11 @@
|
||||
<view class="top-height"></view>
|
||||
<view class="week">{{dateStr}}</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
|
||||
:up="upOption" :down="downOption" :fixed="false" class="scroll-h" :class="{'loading-scroll':cssFlag}">
|
||||
<!-- 列表 @up="upCallback" -->
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit"
|
||||
@down="downCallback" :down="downOption" :up="upOption"
|
||||
:fixed="false" class="scroll-h"
|
||||
:class="{'loading-scroll':cssFlag}">
|
||||
<view class="white-bg">
|
||||
<view class="blue-title">日常巡检</view>
|
||||
<block v-if="list1.length>0">
|
||||
@@ -135,8 +137,8 @@
|
||||
</view>
|
||||
<view class="r-list">
|
||||
<view class="r-left">
|
||||
<view class="r-l-left">跟踪次数<span class="r-gray">{{ item.count }}</span></view>
|
||||
<view class="r-l-right">最近跟踪时间<span class="r-gray">{{ item.planTime }}</span></view>
|
||||
<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>
|
||||
</view>
|
||||
<view class="report-border" v-if="index<list3.length-1"></view>
|
||||
@@ -157,24 +159,22 @@ import customHeader from '@/components/customHeader.vue';
|
||||
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import { parseTime } from '@/utils/datetime.js';
|
||||
import { formatTaskStatus } from '@/utils/status.js';
|
||||
import { noticeList } from '@/api/notice.js'
|
||||
import { taskTodayList } from '@/api/polling.js'
|
||||
|
||||
// '2025-12-29 星期五'
|
||||
let dateStr = ref('');
|
||||
|
||||
onLoad(option => {
|
||||
let date = new Date();
|
||||
dateStr.value = parseTime(date,'{y}-{m}-{d} 星期{a}');
|
||||
})
|
||||
|
||||
|
||||
// 查询列表
|
||||
let list1 = ref([]);
|
||||
let list2 = ref([]);
|
||||
let list3 = ref([]);
|
||||
const mescrollRef = ref(null);
|
||||
const upOption = ref({
|
||||
// use: false,
|
||||
use: false,
|
||||
page: { num: 0, size: 10 },
|
||||
noMoreSize: 5,
|
||||
empty: {
|
||||
@@ -186,7 +186,7 @@ const upOption = ref({
|
||||
});
|
||||
|
||||
const downOption = ref({
|
||||
auto: false,
|
||||
auto: true,
|
||||
textInOffset: '下拉刷新',
|
||||
textOutOffset: '释放更新',
|
||||
textLoading: '刷新中...'
|
||||
@@ -207,13 +207,11 @@ const downCallback = async (mescroll) => {
|
||||
list1.value = res.list1;
|
||||
list2.value = res.list2;
|
||||
list3.value = res.list3;
|
||||
mescroll.resetUpScroll();
|
||||
// mescroll.resetUpScroll();
|
||||
} catch (error) {
|
||||
mescroll.endErr();
|
||||
} finally {
|
||||
setTimeout(async ()=>{
|
||||
mescroll.endSuccess();
|
||||
},500);
|
||||
mescroll.endSuccess();
|
||||
}
|
||||
}
|
||||
// 上拉加载更多
|
||||
@@ -236,6 +234,7 @@ const upCallback = async (mescroll) => {
|
||||
|
||||
// 获取数据列表
|
||||
const getList = (pageIndex, pageSize) => {
|
||||
|
||||
return new Promise(async (resolve) => {
|
||||
let param = {
|
||||
pageIndex,
|
||||
@@ -356,7 +355,7 @@ const getList = (pageIndex, pageSize) => {
|
||||
// total: res.recordCount || 0
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 查看详情 type 1-任务详情 2-问题详情
|
||||
|
||||
@@ -23,33 +23,51 @@
|
||||
巡检日期:<text>{{parseTime(optionObj.planTime,'{y}-{m}-{d} 星期{a}')}}</text>
|
||||
</view>
|
||||
<view class="report-list" v-for="(item, index) in optionObj.list" :key="index">
|
||||
<!-- 单选 or 判断 -->
|
||||
<block v-if="item.pointType==1||item.pointType==3">
|
||||
<view class="r-list">
|
||||
<view class="r-left">
|
||||
<view>{{String(index+1).padStart(2, '0')+'.'}}</view>
|
||||
<view>{{ item.pointName }}</view>
|
||||
</view>
|
||||
<view class="r-right">
|
||||
<radio-group @change="radioChange" style="transform:scale(0.9)">
|
||||
<radio value="1" color="#02C74C" style="margin-right:30rpx;" >是</radio>
|
||||
<radio value="2" color="#02C74C">否</radio>
|
||||
</radio-group>
|
||||
</view>
|
||||
<!-- 单选 -->
|
||||
<block v-if="item.pointType==1">
|
||||
<view class="r-left">
|
||||
<view>{{String(index+1).padStart(2, '0')+'.'}}</view>
|
||||
<view>{{ item.pointName }}</view>
|
||||
</view>
|
||||
</block>
|
||||
<multipleSelect :multiple="false" :value="item.chooseList" downInner
|
||||
:options="item.optionList" @change="(...args) => changeCheck(...args, item)"
|
||||
:slabel="'optionContent'" :svalue="'optionId'"
|
||||
>
|
||||
</multipleSelect>
|
||||
</block>
|
||||
<!-- 多选 -->
|
||||
<block v-else-if="item.pointType==2">
|
||||
<view class="r-left">
|
||||
<view>{{String(index+1).padStart(2, '0')+'.'}}</view>
|
||||
<view>{{ item.pointName }}</view>
|
||||
</view>
|
||||
<multipleSelect :multiple="true" :value="chooseList" downInner
|
||||
:options="checkList" @change="changeCheck"
|
||||
:slabel="'text'"
|
||||
<multipleSelect :multiple="true" :value="item.chooseList" downInner
|
||||
:options="item.optionList" @change="(...args) => changeCheck(...args, item)"
|
||||
:slabel="'optionContent'" :svalue="'optionId'"
|
||||
>
|
||||
</multipleSelect>
|
||||
</block>
|
||||
<!-- 判断 -->
|
||||
<block v-if="item.pointType==3">
|
||||
<view class="r-list">
|
||||
<view class="r-left">
|
||||
<view>{{String(index+1).padStart(2, '0')+'.'}}</view>
|
||||
<view>{{ item.pointName }}</view>
|
||||
</view>
|
||||
<view class="r-right">
|
||||
<radio-group @change="radioChange($event,item)" style="transform:scale(0.9)">
|
||||
<!-- <radio value="1" color="#02C74C" style="margin-right:30rpx;" >是</radio>
|
||||
<radio value="2" color="#02C74C">否</radio> -->
|
||||
<radio :value="item2.optionId+''" color="#02C74C"
|
||||
v-for="(item2,index) in item.optionList" :key="index"
|
||||
:style="{marginRight:index==0?'30rpx':'0'}"
|
||||
>
|
||||
{{item2.optionContent}}
|
||||
</radio>
|
||||
</radio-group>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 问答 -->
|
||||
<block v-else-if="item.pointType==4">
|
||||
<view class="r-left">
|
||||
@@ -164,7 +182,7 @@ import multipleSelect from "@/components/multipleSelect.vue";
|
||||
import pollingShowModal from "@/components/pollingShowModal.vue";
|
||||
import { parseTime } from '@/utils/datetime.js';
|
||||
import { formatTaskStatus } from '@/utils/status.js';
|
||||
import { noticeList } from '@/api/notice.js'
|
||||
import { taskDetail } from '@/api/polling.js'
|
||||
import {uploadFileMinio} from '@/utils/minio.js'
|
||||
|
||||
let workId = ref(undefined);
|
||||
@@ -197,18 +215,132 @@ const getList = () => {
|
||||
optionName:'配电箱箱体和内部线路检查',
|
||||
planTime:new Date().getTime(),
|
||||
list:[
|
||||
{ pointName:'技术中心机房总电源', optionId:202512297899, pointType:1, },
|
||||
{ pointName:'监控室消防设备阀门正常开启闭合', optionId:202512297899, pointType:2, },
|
||||
{ pointName:'监控室10组灭火器压力指针处于绿色区域', optionId:202512297899, pointType:3,},
|
||||
{ pointName:'库房灭火器压力指针处于绿色区', optionId:202512297899,pointType:4,},
|
||||
{ pointName:'技术中心机房总电源', optionId:202512297899,pointType:5,},
|
||||
{ pointName:'监控室消防设备阀门正常监控室消防设备阀门正常监控室消防设备阀门正常', optionId:202512297899,pointType:6,},
|
||||
{ pointName:'库房灭火器压力指针处于绿色区', optionId:202512297899,pointType:7,},
|
||||
{ pointName:'技术中心机房总电源', optionId:202512297899,pointType:8,},
|
||||
{
|
||||
pointName:'技术中心机房总电源', pointId:202512297899, pointType:1,
|
||||
optionList:[
|
||||
{
|
||||
"optionId": 189,
|
||||
"pointId": 188,
|
||||
"optionTitle": "A",
|
||||
"optionContent": "卫生检查1",
|
||||
"createTime": "2025-11-11 11:48:43",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:48:43",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 190,
|
||||
"pointId": 188,
|
||||
"optionTitle": "B",
|
||||
"optionContent": "卫生检查2",
|
||||
"createTime": "2025-11-11 11:48:43",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:48:43",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 191,
|
||||
"pointId": 188,
|
||||
"optionTitle": "C",
|
||||
"optionContent": "卫生检查3",
|
||||
"createTime": "2025-11-11 11:48:43",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:48:43",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 192,
|
||||
"pointId": 188,
|
||||
"optionTitle": "D",
|
||||
"optionContent": "卫生检查4",
|
||||
"createTime": "2025-11-11 11:48:43",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:48:43",
|
||||
"modifyUser": "SSEYS1695"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ pointName:'监控室消防设备阀门正常开启闭合', pointId:202512297899, pointType:2,
|
||||
optionList:[
|
||||
{
|
||||
"optionId": 182,
|
||||
"pointId": 122,
|
||||
"optionTitle": "A",
|
||||
"optionContent": "区域一",
|
||||
"createTime": "2025-11-11 11:40:52",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:40:52",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 183,
|
||||
"pointId": 122,
|
||||
"optionTitle": "B",
|
||||
"optionContent": "区域二",
|
||||
"createTime": "2025-11-11 11:40:52",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:40:52",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 184,
|
||||
"pointId": 122,
|
||||
"optionTitle": "C",
|
||||
"optionContent": "区域三",
|
||||
"createTime": "2025-11-11 11:40:52",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:40:52",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 185,
|
||||
"pointId": 122,
|
||||
"optionTitle": "D",
|
||||
"optionContent": "区域四",
|
||||
"createTime": "2025-11-11 11:40:52",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 11:40:52",
|
||||
"modifyUser": "SSEYS1695"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ pointName:'监控室10组灭火器压力指针处于绿色区域', pointId:202512297899, pointType:3,
|
||||
optionList:[
|
||||
{
|
||||
"optionId": 154,
|
||||
"pointId": 127,
|
||||
"optionTitle": "A",
|
||||
"optionContent": "是",
|
||||
"createTime": "2025-11-11 09:56:34",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 09:56:34",
|
||||
"modifyUser": "SSEYS1695"
|
||||
},
|
||||
{
|
||||
"optionId": 155,
|
||||
"pointId": 127,
|
||||
"optionTitle": "B",
|
||||
"optionContent": "否",
|
||||
"createTime": "2025-11-11 09:56:34",
|
||||
"createUser": "SSEYS1695",
|
||||
"modifyTime": "2025-11-11 09:56:34",
|
||||
"modifyUser": "SSEYS1695"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ pointName:'库房灭火器压力指针处于绿色区', pointId:202512297899,pointType:4,},
|
||||
{ pointName:'技术中心机房总电源', pointId:202512297899,pointType:5,},
|
||||
{ pointName:'监控室消防设备阀门正常监控室消防设备阀门正常监控室消防设备阀门正常', pointId:202512297899,pointType:6,},
|
||||
{ pointName:'库房灭火器压力指针处于绿色区', pointId:202512297899,pointType:7,},
|
||||
{ pointName:'技术中心机房总电源', pointId:202512297899,pointType:8,},
|
||||
],
|
||||
}
|
||||
}
|
||||
optionObj.value = res.data||{};
|
||||
let data = res.data||{};
|
||||
// data.list.forEach(item=>{
|
||||
// item.chooseList
|
||||
// })
|
||||
optionObj.value = data
|
||||
}
|
||||
|
||||
// 跳转问题上报页面
|
||||
@@ -219,14 +351,18 @@ const handleQuestion=()=>{
|
||||
}
|
||||
|
||||
// radio 单选选择
|
||||
const radioChange=(e)=>{
|
||||
console.log(e)
|
||||
const radioChange=(e,item)=>{
|
||||
// console.log(e,item)
|
||||
let radioValue = e.detail.value;
|
||||
item['optionIds']=radioValue;
|
||||
|
||||
}
|
||||
|
||||
// 多选处理
|
||||
let chooseList = reactive([0]);
|
||||
const changeCheck = (item, value) => {
|
||||
chooseList = item;
|
||||
// 单选多选处理
|
||||
const changeCheck = (param,param2,item) => {
|
||||
// console.log(param,param2,item)
|
||||
item['optionIds'] = param2.join(",");
|
||||
// console.log(item)
|
||||
}
|
||||
|
||||
// 照片及拍照处理
|
||||
@@ -350,6 +486,7 @@ const handleScan = () => {
|
||||
scanStr.value = res.result;
|
||||
console.log('扫码结果:', res.result); // 二维码内容
|
||||
console.log('码类型:', res.scanType); // 码类型,如 QR_CODE
|
||||
// ['optionIds'] = res.result;
|
||||
// 处理扫码结果,例如跳转页面
|
||||
// 如果是URL,可以跳转
|
||||
// if (res.result.startsWith('http')) {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
</view>
|
||||
<view class="r-list">
|
||||
<view class="r-left">
|
||||
<view class="r-l-left">跟踪次数<span class="r-gray">{{ item.count }}</span></view>
|
||||
<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>
|
||||
</view>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<view class="report-list">
|
||||
<view class="report-pro">问题项</view>
|
||||
<view class="report-right">
|
||||
<view class="r-list" v-for="(item, index) in optionObj.list" :key="index">
|
||||
<view class="r-list" v-for="(item, index) in optionObj.list" :key="index" @click="handleRound(item)">
|
||||
<view class="r-left" :class="{'r-red':item.active}">
|
||||
<view>{{String(index+1).padStart(2, '0')+'.'}}</view>
|
||||
<view>{{ item.pointName }}</view>
|
||||
@@ -122,19 +122,24 @@ const chooseMedia = () => {
|
||||
success: (res) => {
|
||||
console.log(res)
|
||||
res.tempFiles.forEach(file => {
|
||||
console.log(`文件类型: ${file.type}, 文件路径: ${file.tempFilePath}`);
|
||||
if (file.type === 'image') {
|
||||
console.log(`文件类型: ${file.fileType}, 文件路径: ${file.tempFilePath}`);
|
||||
if (file.fileType === 'image') {
|
||||
// 显示本地图片
|
||||
imgArr.value.push(file)
|
||||
imgArr.value.push(file.tempFilePath)
|
||||
} else if (file.type === 'video') {
|
||||
// 处理视频
|
||||
videoArr.value.push(file)
|
||||
videoArr.value.push(file.tempFilePath)
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 红点点击
|
||||
const handleRound=(item)=>{
|
||||
item.active=!item.active
|
||||
}
|
||||
|
||||
// 提交
|
||||
const handleSubmit=()=>{
|
||||
// showModel('有未完成的巡检项');
|
||||
@@ -207,7 +212,7 @@ const handleSubmit=()=>{
|
||||
.report-list .r-left{
|
||||
display: flex;
|
||||
/* align-items: center; */
|
||||
width:70%;
|
||||
width:90%;
|
||||
font-size:28rpx;
|
||||
color:#919191;
|
||||
}
|
||||
@@ -249,10 +254,27 @@ const handleSubmit=()=>{
|
||||
line-height: 30rpx;
|
||||
/* #endif */
|
||||
/* #ifdef APP-PLUS */
|
||||
height:30rpx;
|
||||
padding-top:5rpx;
|
||||
height:33rpx;
|
||||
padding-top:2rpx;
|
||||
/* #endif */
|
||||
}
|
||||
.report-list .img-flex{
|
||||
display: flex;
|
||||
flex-flow:row wrap;
|
||||
margin-bottom:30rpx;
|
||||
}
|
||||
.report-list .img-show img,
|
||||
.report-list .img-show video{
|
||||
width:210rpx;
|
||||
height: 140rpx;
|
||||
}
|
||||
.report-list .img-show :deep(.uni-video-cover-play-button){
|
||||
width:64rpx;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
font-size:60rpx;
|
||||
}
|
||||
|
||||
.report-list .img-con{
|
||||
background-color: #EEEEEE;
|
||||
width:210rpx;
|
||||
@@ -269,13 +291,9 @@ const handleSubmit=()=>{
|
||||
.report-list .img-show,
|
||||
.report-list .img-con{
|
||||
width: calc(100% / 3 - 10px); /* 减去一些间隙以避免溢出 */
|
||||
margin:20rpx 10rpx 0;
|
||||
margin:20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
.report-list .img-show:first-child,
|
||||
.report-list .img-con:first-child{
|
||||
margin-left:0;
|
||||
}
|
||||
|
||||
.btn-submit{
|
||||
width:400rpx;
|
||||
|
||||
@@ -186,8 +186,8 @@
|
||||
</view>
|
||||
<view class="r-list">
|
||||
<view class="r-left">
|
||||
<view class="r-l-left">跟踪次数<span class="r-gray">{{ item.count }}</span></view>
|
||||
<view class="r-l-right">最近跟踪时间<span class="r-gray">{{ item.planTime }}</span></view>
|
||||
<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>
|
||||
</view>
|
||||
<view class="report-border" v-if="index<row.list3.length-1"></view>
|
||||
|
||||
@@ -7,33 +7,34 @@
|
||||
></customHeader>
|
||||
<!-- 高度来避免头部遮挡 -->
|
||||
<view class="top-height"></view>
|
||||
<view class="week">{{dateStr}}</view>
|
||||
|
||||
<view class="week">{{parseTime(taskObj.planTime,'{y}-{m}-{d} 星期{a} {h}:{i}')}}开始 时长{{taskObj.workHour}}小时</view>
|
||||
<view class="bg-progress">
|
||||
<view class="progress-container">
|
||||
<circleTemplate :progress="progress"></circleTemplate>
|
||||
<span>{{ progress }}%</span>
|
||||
<span>{{ taskObj.progress }}%</span>
|
||||
</view>
|
||||
<view class="polling">
|
||||
<view class="p-title p-border">巡检单号<text>20251229789</text></view>
|
||||
<view class="p-title">完成进度<text class="p-blue">3</text>/9</view>
|
||||
<view class="p-title p-border">巡检单号<text>{{taskObj.taskId}}</text></view>
|
||||
<view class="p-title">完成进度<text class="p-blue">{{taskObj.count}}</text>/{{taskObj.total}}</view>
|
||||
<view class="btn-primary">
|
||||
<button type="primary" size="mini">任务提交</button>
|
||||
<button type="primary" size="mini" @click="handleConfirm">任务提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 列表 -->
|
||||
<view class="white-bg2">
|
||||
<!-- @up="upCallback" :up="upOption" -->
|
||||
<mescroll-uni ref="mescrollRef" @init="mescrollInit"
|
||||
@down="downCallback" :down="downOption"
|
||||
@up="upCallback" :up="upOption"
|
||||
@down="downCallback" :down="downOption" :up="upOption"
|
||||
:fixed="false" class="scroll-h"
|
||||
:class="{'loading-scroll':cssFlag}"
|
||||
>
|
||||
<view class="white-bg">
|
||||
<view class="blue-title">日常巡检任务AAA</view>
|
||||
<block v-if="list.length>0">
|
||||
<view class="report-list" v-for="(item, index) in list" :key="index" @click="handleDetail(item,1)">
|
||||
<view class="blue-title">{{taskObj.taskName}}</view>
|
||||
<block v-if="taskObj.list.length>0">
|
||||
<view class="report-list" v-for="(item, index) in taskObj.list" :key="index" @click="handleDetail(item,1)">
|
||||
<view class="r-list">
|
||||
<view class="r-left">{{ item.workName }}</view>
|
||||
<view class="r-right">
|
||||
@@ -44,7 +45,7 @@
|
||||
<uni-icons type="right" size="20" color="#A0A0A0"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
<view class="report-border" :style="{borderColor:index<list.length-1?'#E7E7E7':'#fff'}"></view>
|
||||
<view class="report-border" :style="{borderColor:index<taskObj.list.length-1?'#E7E7E7':'#fff'}"></view>
|
||||
</view>
|
||||
</block>
|
||||
<view v-else class="no-data">
|
||||
@@ -54,8 +55,8 @@
|
||||
<!-- 问题跟踪 -->
|
||||
<view class="bg-border"></view>
|
||||
<view class="red-title">问题跟踪</view>
|
||||
<block v-if="questList.length>0">
|
||||
<view class="report-list" v-for="(item, index) in questList" :key="index" @click="handleDetail(item,2)">
|
||||
<block v-if="taskObj.questList.length>0">
|
||||
<view class="report-list" v-for="(item, index) in taskObj.questList" :key="index" @click="handleDetail(item,2)">
|
||||
<view class="r-list" style="padding-bottom:0">
|
||||
<view class="r-name">{{ item.problemDesc }}</view>
|
||||
<view class="r-right">
|
||||
@@ -66,11 +67,11 @@
|
||||
</view>
|
||||
<view class="r-list">
|
||||
<view class="r-left">
|
||||
<view class="r-l-left">跟踪次数<span class="r-gray">{{ item.count }}</span></view>
|
||||
<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>
|
||||
</view>
|
||||
<view class="report-border" v-if="index<questList.length-1"></view>
|
||||
<view class="report-border" v-if="index<taskObj.questList.length-1"></view>
|
||||
</view>
|
||||
</block>
|
||||
<view v-else class="no-data">
|
||||
@@ -90,7 +91,7 @@ import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
|
||||
import circleTemplate from '@/components/circleTemplate.vue';
|
||||
import { parseTime } from '@/utils/datetime.js';
|
||||
import { formatTaskStatus } from '@/utils/status.js';
|
||||
import { noticeList } from '@/api/notice.js'
|
||||
import { taskDetail } from '@/api/polling.js'
|
||||
|
||||
// '2025-12-29 星期五'
|
||||
let taskId = ref(undefined);
|
||||
@@ -99,23 +100,17 @@ const progress = ref(0); // 初始进度为0
|
||||
onLoad(option => {
|
||||
// console.log(option)
|
||||
taskId.value = option.id;
|
||||
|
||||
let date = new Date();
|
||||
let dstr = parseTime(date,'{y}-{m}-{d} 星期{a}');
|
||||
dateStr.value = dstr + " 14:00开始 时长6小时";
|
||||
|
||||
setTimeout(() => {
|
||||
progress.value=62
|
||||
}, 1000);
|
||||
})
|
||||
|
||||
|
||||
// 查询列表
|
||||
let list = ref([]);
|
||||
let questList = ref([]);//问题列表
|
||||
let taskObj = ref({
|
||||
list:[],
|
||||
questList:[]
|
||||
});
|
||||
const mescrollRef = ref(null);
|
||||
const upOption = ref({
|
||||
// use: false,
|
||||
use: false,
|
||||
page: { num: 0, size: 10 },
|
||||
noMoreSize: 5,
|
||||
empty: {
|
||||
@@ -127,7 +122,7 @@ const upOption = ref({
|
||||
});
|
||||
|
||||
const downOption = ref({
|
||||
auto: false,
|
||||
auto: true,
|
||||
textInOffset: '下拉刷新',
|
||||
textOutOffset: '释放更新',
|
||||
textLoading: '刷新中...'
|
||||
@@ -145,8 +140,7 @@ const downCallback = async (mescroll) => {
|
||||
console.log("下拉刷新")
|
||||
const res = await getList(1, upOption.value.page.size);
|
||||
cssFlag.value = false;
|
||||
list.value = res.list;
|
||||
questList.value=res.questList
|
||||
taskObj.value = res;
|
||||
mescroll.resetUpScroll();
|
||||
} catch (error) {
|
||||
mescroll.endErr();
|
||||
@@ -162,8 +156,7 @@ const upCallback = async (mescroll) => {
|
||||
console.log("上拉加载更多")
|
||||
let res = await getList(mescroll.num, mescroll.size);
|
||||
if (mescroll.num === 1) {
|
||||
list.value = res.list;
|
||||
questList.value=res.questList
|
||||
taskObj.value = res;
|
||||
} else {
|
||||
// list.value.push(...res.list);
|
||||
}
|
||||
@@ -180,11 +173,18 @@ const getList = (pageIndex, pageSize) => {
|
||||
pageIndex,
|
||||
pageSize,
|
||||
}
|
||||
// let res = await noticeList(param);
|
||||
// let res = await taskDetail(param);
|
||||
let res = {
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {
|
||||
taskId:236,
|
||||
taskName:'日常巡检任务AAA',
|
||||
planTime:new Date().getTime(),
|
||||
progress:62,
|
||||
count:3,
|
||||
total:9,
|
||||
workHour:1,
|
||||
list:[
|
||||
{
|
||||
workName:'技术中心机房总电源',
|
||||
@@ -327,6 +327,7 @@ const getList = (pageIndex, pageSize) => {
|
||||
}
|
||||
}
|
||||
let data = res.data||{};
|
||||
progress.value = data.progress
|
||||
resolve({
|
||||
...data,
|
||||
// total: res.recordCount || 0
|
||||
@@ -335,6 +336,11 @@ const getList = (pageIndex, pageSize) => {
|
||||
|
||||
}
|
||||
|
||||
// 执行提交
|
||||
const handleConfirm=()=>{
|
||||
|
||||
}
|
||||
|
||||
// 查看详情 type 1-详情 2-问题详情
|
||||
const handleDetail = (item,type) =>{
|
||||
let url=''
|
||||
@@ -389,6 +395,7 @@ const handleDetail = (item,type) =>{
|
||||
font-size:26rpx;
|
||||
color:#fff;
|
||||
padding:10rpx 30rpx 20rpx 0;
|
||||
width:328rpx;
|
||||
}
|
||||
.polling .p-title.p-border{
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
|
||||
|
||||
Reference in New Issue
Block a user