对接首页部分接口,完善历史巡检

This commit is contained in:
xhc 2025-06-12 16:43:14 +08:00
parent ed7e524b4c
commit 83148c376b
11 changed files with 338 additions and 156 deletions

View File

@ -2,7 +2,7 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-19 10:21:48 * @Date: 2025-05-19 10:21:48
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-06-09 16:31:54 * @LastEditTime: 2025-06-11 17:01:41
* @Description: * @Description:
--> -->
<script> <script>
@ -65,7 +65,7 @@ export default {
justify-content: space-between; justify-content: space-between;
padding: 10rpx 0; padding: 10rpx 0;
.title { .title {
width: 70%; width: 75%;
display: inline-block; display: inline-block;
height: 30rpx; height: 30rpx;
line-height: 30rpx; line-height: 30rpx;
@ -86,9 +86,8 @@ export default {
font-size: 24rpx; font-size: 24rpx;
.info-text { .info-text {
display: inline-block; display: inline-block;
width: 70%;
margin-left: 10rpx; margin-left: 10rpx;
vertical-align: bottom;
} }
} }
} }
@ -137,6 +136,7 @@ export default {
// //
.info-card { .info-card {
padding: 30rpx 0;
padding-bottom: 30rpx; padding-bottom: 30rpx;
margin: 0 30rpx; margin: 0 30rpx;
border-radius: 10rpx; border-radius: 10rpx;
@ -145,17 +145,10 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 0 20rpx; padding: 0 20rpx 20rpx;
font-size: 32rpx; :deep(.uni-section) {
font-weight: 700; font-weight: 700;
// :deep(.uni-section) { }
// flex: 1;
// margin-right: 20rpx;
// .title {
// font-size: 32rpx;
// color: #0A61B9;
// }
// }
} }
.info-box { .info-box {
border: 10rpx solid #0A61B9; border: 10rpx solid #0A61B9;
@ -175,7 +168,7 @@ export default {
} }
} }
} }
:deep(.checklist-box.is--tag.is-checked), :deep(uni-button) { :deep(.checklist-box.is--tag.is-checked), :deep(uni-button[type='primary']) {
background-color: #004894!important; background-color: #004894!important;
border-color: #004894!important; border-color: #004894!important;
} }

View File

@ -2,7 +2,7 @@
* @Author: xhc * @Author: xhc
* @Date: 2025-05-19 10:44:34 * @Date: 2025-05-19 10:44:34
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-06-03 14:07:17 * @LastEditTime: 2025-06-12 10:30:25
* @FilePath: \bht-app\src\api\api.js * @FilePath: \bht-app\src\api\api.js
* @Description: api * @Description: api
*/ */
@ -18,7 +18,12 @@ export const getRoutePage = () => {
return http('/bht/patrolRoute/findPage', 'post') return http('/bht/patrolRoute/findPage', 'post')
} }
// 查询点位路线 // 查询巡检任务列表
export const getPointList = () => { export const getTaskList = (data) => {
return http('/bht/patrolPoint/findList', 'post') return http('/bht/patrolTask/findList', 'post', data)
}
// 巡检记录列表查询
export const getRecordList = (data) => {
return http('/bht/patrolRecord/findPage', 'post', data)
} }

View File

@ -581,7 +581,7 @@ export default defineComponent({
handlePopupMask, handlePopupMask,
handleMove, handleMove,
getMenuValue, getMenuValue,
closeMenuPopup,
handleCellSelect, handleCellSelect,
handleFilterConfirm, handleFilterConfirm,
handlePickerConfirm, handlePickerConfirm,

View File

@ -2,7 +2,7 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-19 10:42:57 * @Date: 2025-05-19 10:42:57
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-05-28 14:00:10 * @LastEditTime: 2025-06-11 09:28:34
* @Description: * @Description:
*/ */
let baseUrl let baseUrl

View File

@ -4,7 +4,6 @@
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTitleText": "知识库",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"onReachBottomDistance": 100 "onReachBottomDistance": 100
} }
@ -54,7 +53,21 @@
{ {
"path": "pages/points/points", "path": "pages/points/points",
"style": { "style": {
"navigationBarTitleText": "巡检点位" "navigationBarTitleText": "巡检点位",
"app-plus": {
"titleNView": {
"buttons": [
{
"text": "保存",
"type": "none",
"colorPressed": "#158EF8",
"color": "#fff",
"fontSize": "16px"
}
]
}
}
} }
}, },
{ {

View File

@ -2,7 +2,7 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-23 15:29:20 * @Date: 2025-05-23 15:29:20
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-05-23 16:28:13 * @LastEditTime: 2025-06-12 16:08:37
* @Description: 历史巡检 * @Description: 历史巡检
--> -->
<template> <template>
@ -13,40 +13,187 @@
<uni-search-bar class="search" radius="15" bgColor="#EDF4FD" placeholder="搜索线路名称" clearButton="auto" cancelButton="none" @confirm="search" /> <uni-search-bar class="search" radius="15" bgColor="#EDF4FD" placeholder="搜索线路名称" clearButton="auto" cancelButton="none" @confirm="search" />
</uni-col> </uni-col>
<uni-col :span="4"> <uni-col :span="4">
<view class="screening"><uni-icons fontFamily="iconfont" color="#fff" :size="20">{{'&#xe621;'}}</uni-icons></view> <view class="screening" @click="screening"><uni-icons fontFamily="iconfont" color="#fff" :size="20">{{'&#xe621;'}}</uni-icons></view>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<uni-card class="list-card" v-for="(item, index) in listData" :key="index"> <uni-card class="list-card" v-for="(item, index) in listData.taskList" :key="index" @click="goToDetail(item)">
<view class="head"> <view class="head">
<text class="title">{{ item.title }}</text> <text class="title">{{ item.routeName }}</text>
<uni-tag :inverted="true" :text="item.state" :type="item.state == '异常' ? 'warning' : 'success'" /> <uni-tag :inverted="true" :text="item.inspectionResult" :type="item.inspectionResult == '异常' ? 'warning' : 'success'" />
</view> </view>
<view class="num grey">线路编号{{ item.num }}</view> <view class="num grey">线路编号{{ item.num }}</view>
<view class="info-box grey"> <view class="info-box grey">
<view class="info"><uni-icons fontFamily="iconfont" color="#1469BC">{{'&#xe753;'}}</uni-icons> {{ item.info }}</view> <view class="info"><uni-icons fontFamily="iconfont" color="#1469BC">{{'&#xe753;'}}</uni-icons> {{ item.deptName }}</view>
<view class="info"><uni-icons fontFamily="iconfont" color="#808185">{{'&#xe74e;'}}</uni-icons> <text>{{ item.time }}</text></view> <view class="info"><uni-icons fontFamily="iconfont" color="#808185">{{'&#xe74e;'}}</uni-icons> <text>{{ item.patrolTime }}</text></view>
</view> </view>
</uni-card> </uni-card>
<!-- 上拉加载更多 -->
<view v-if="listData.isLoadMore">
<uni-load-more :status="listData.loadStatus" ></uni-load-more>
</view>
<!-- 筛选 -->
<DaDropdown
ref="daDropdownRef"
v-model:dropdownMenu="dropdownMenuList">
<template #slot3>
<view class="time"><text>日期</text><uni-datetime-picker class="time-picker" type="daterange" v-model="menuVal.datetimesingle" @change="changeTime"/></view>
<!-- <view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view>
<view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view>
<view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view>
<view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view>
<view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view>
<view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view>
<view><uni-datetime-picker type="daterange" v-model="dropdownMenuList.datetimesingle" /></view> -->
<view class="btn">
<button type="default" size="mini" plain="true" @click="handleReset">重置</button>
<button type="primary" size="mini" @click="handleConfirm">确定</button>
</view>
</template>
</DaDropdown>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import { onLoad, onReachBottom } from "@dcloudio/uni-app";
import { getRecordList } from '@/api/api.js'
import DaDropdown from '@/components/da-dropdown/index.vue'
// //
let listData = reactive([ let listData = reactive({
{ title: '左岸白班机组', state: '异常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, page: {
{ title: '左岸主变洞及出线场(上午)', state: '正常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, pageSize: 10, //
{ title: '左岸白班机组', state: '异常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, pageNum: 1, //
{ title: '左岸主变洞及出线场(上午)', state: '正常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, },
{ title: '左岸白班机组', state: '异常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, loadStatus:'loading', //more-loading-nomore-
{ title: '左岸主变洞及出线场(上午)', state: '正常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, isLoadMore:false, //
{ title: '左岸白班机组', state: '异常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, taskList: [
{ title: '左岸主变洞及出线场(上午)', state: '正常', num: 'BHT-YX-XJ-L1.2', info: '运行部 :五值 :白班', time: '2025-02-20 11:20' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '线()', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '线()', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '线()', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
// { title: '线()', state: '', num: 'BHT-YX-XJ-L1.2', info: ' : :', time: '2025-02-20 11:20' },
]
})
const daDropdownRef = ref(null)
const menuVal = reactive({
datetimesingle: []
})
const dropdownMenuList = ref([
{
title: '插槽',
type: 'slot3',
prop: 'god3',
// 22330
// value: { ft1: '2', ft2: ['2', '3'], ft3: 30 },
// options: [
// {
// title: '',
// type: 'radio',
// prop: 'ft1',
// options: [
// { label: '1', value: '1' },
// { label: '2', value: '2' },
// { label: '3', value: '3' },
// { label: '4', value: '4' },
// ],
// },
// {
// title: '',
// type: 'checkbox',
// prop: 'ft2',
// options: [
// { label: '1', value: '1' },
// { label: '2', value: '2' },
// { label: '3', value: '3' },
// { label: '4', value: '4' },
// { label: '5', value: '5' },
// ],
// },
// {
// title: '',
// type: 'slider',
// prop: 'ft3',
// componentProps: {
// min: 0,
// max: 100,
// step: 1,
// showValue: true,
// },
// },
// ],
},
]) ])
onLoad(() => {
queryList()
})
//
onReachBottom(() => {
if(!listData.isLoadMore){
listData.isLoadMore = true
listData.page.pageNum += 1
queryList()
}
})
//
const queryList = () => {
getRecordList(listData.page).then(res => {
if (res.code == 200) {
listData.taskList = [...listData.taskList, ...res.data.records]
if (res.data.records.length < listData.page.pageSize) {
listData.isLoadMore = true
listData.loadStatus = 'nomore'
} else {
listData.loadStatus = 'more'
}
} else {
listData.isLoadMore = false
listData.loadStatus = 'more'
}
})
}
//
const goToDetail = (item) => {
uni.navigateTo({
url: `/pages/startInspection/startInspection?data=${JSON.stringify(item)}&mode=detail`
});
}
//
const screening = () => {
daDropdownRef.value?.handleMenuClick()
}
const changeTime = (e) => {
menuVal.datetimesingle = e;
}
//
const handleReset = () => {
menuVal.datetimesingle = []
}
//
const handleConfirm = () => {
daDropdownRef.value?.closeMenuPopup()
console.log(menuVal.datetimesingle);
}
// //
const search = () => { const search = () => {
@ -64,5 +211,40 @@ const search = () => {
text-align: center; text-align: center;
} }
} }
.time {
display: flex;
align-items: baseline;
margin: 30rpx;
.time-picker {
width: 80%;
}
}
.btn {
display: flex;
margin: 30rpx 0;
uni-button {
width: 40%;
border-radius: 40rpx;
}
}
:deep(.da-dropdown-menu) {
position: absolute!important;
width: 90rpx;
height: 55rpx;
top: 25rpx!important;
right: 45rpx!important;
opacity: 0;
}
:deep(.da-dropdown-content) {
top: 115rpx!important;
// height: 100vh;
}
:deep(.da-dropdown-content-popup) {
// height: 850rpx!important;
}
:deep(.uni-calendar__content) {
position: relative;
}
// uni-calendar__mask
} }
</style> </style>

View File

@ -2,7 +2,7 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-19 11:07:37 * @Date: 2025-05-19 11:07:37
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-06-09 09:40:25 * @LastEditTime: 2025-06-12 11:01:27
* @Description: 首页 * @Description: 首页
--> -->
<template> <template>
@ -31,7 +31,7 @@
{{ item.name }} {{ item.name }}
</view> </view>
</scroll-view> </scroll-view>
<view v-if="navCurIndex == 0"> <view>
<uni-card :is-shadow="false" class="patrol-card" > <uni-card :is-shadow="false" class="patrol-card" >
<view class="time">巡检时间<text>{{ patrolData.time }}</text></view> <view class="time">巡检时间<text>{{ patrolData.time }}</text></view>
<view class="card-info"> <view class="card-info">
@ -82,28 +82,34 @@
<view> <view>
<uni-card class="list-card" v-for="(item, index) in listData.taskList" :key="index" @click="goToStartInspection(item)"> <uni-card class="list-card" v-for="(item, index) in listData.taskList" :key="index" @click="goToStartInspection(item)">
<view class="head"> <view class="head">
<text class="title">{{ item.title }}</text> <text class="title">{{ item.patrolRouteVo.patrolRoute?.routeName }}</text>
<!-- <uni-tag :inverted="true" :text="item.state == 0 ? '已巡检' : '未巡检'" :type="item.state == 0 ? 'success' : 'error'" /> --> <uni-tag :inverted="true" :text="item.patrolTask?.state == 2 ? '已巡检' : item.patrolTask?.state == 1 ? '巡检中' : '未巡检'" :type="item.patrolTask?.state == 2 ? 'success' : item.patrolTask?.state == 1 ? 'warning' : 'error'" />
<uni-tag :inverted="true" :text="item.state" :type="item.state == '已巡检' ? 'success' : 'error'" /> <!-- <uni-tag :inverted="true" :text="item.patrolTask.state" :type="item.state == '已巡检' ? 'success' : 'error'" /> -->
</view> </view>
<view class="num grey">线路编号{{ item.num }}</view> <view class="num grey">线路编号{{ item.patrolRouteVo.patrolRoute?.routeNumber }}</view>
<view class="info-box grey"> <view class="info-box grey">
<view class="info"> <uni-icons fontFamily="iconfont" color="#808185">{{'&#xe74e;'}}</uni-icons> {{ item.info }}</view> <!-- <uni-row :gutter="20">
<uni-col :span="18"> -->
<view class="info"> <uni-icons fontFamily="iconfont" color="#808185">{{'&#xe74e;'}}</uni-icons> <text class="info-text" v-if="item.patrolRouteVo.frequencys[0]?.frequencyType">{{ item.patrolRouteVo.frequencys[0]?.frequencyType }} {{ item.patrolRouteVo.frequencys[0]?.frequencyValue }}</text> </view>
<!-- </uni-col> -->
<!-- <uni-col :span="6"> -->
<text class="info">任务 {{ item.task }}</text> <text class="info">任务 {{ item.task }}</text>
<!-- </uni-col> -->
<!-- </uni-row> -->
</view> </view>
</uni-card> </uni-card>
<view v-if="listData.isLoadMore"> <!-- <view v-if="listData.isLoadMore">
<uni-load-more :status="listData.loadStatus" ></uni-load-more> <uni-load-more :status="listData.loadStatus" ></uni-load-more>
</view> </view> -->
</view> </view>
<!-- <view v-if="categoryCurIndex == 1"></view> <!-- <view v-if="categoryCurIndex == 1"></view>
<view v-if="categoryCurIndex == 2"></view> <view v-if="categoryCurIndex == 2"></view>
<view v-if="categoryCurIndex == 3"></view> --> <view v-if="categoryCurIndex == 3"></view> -->
</view> </view>
</view> </view>
<view v-if="navCurIndex == 1">发电分部</view> <!-- <view v-if="navCurIndex == 1">发电分部</view>
<view v-if="navCurIndex == 2">自动分部</view> <view v-if="navCurIndex == 2">自动分部</view>
<view v-if="navCurIndex == 3">保护分部</view> <view v-if="navCurIndex == 3">保护分部</view> -->
</view> </view>
<!-- 回到顶部 --> <!-- 回到顶部 -->
<view class="top-back" @click="topBack" v-if="isShow"> <view class="top-back" @click="topBack" v-if="isShow">
@ -117,7 +123,7 @@
import { nextTick, onMounted, reactive, ref } from "vue"; import { nextTick, onMounted, reactive, ref } from "vue";
import { onReachBottom, onLoad, onShow, onPullDownRefresh, onPageScroll } from "@dcloudio/uni-app"; import { onReachBottom, onLoad, onShow, onPullDownRefresh, onPageScroll } from "@dcloudio/uni-app";
import Dashboard from "@/components/echarts/dashboard.vue"; import Dashboard from "@/components/echarts/dashboard.vue";
import { getRouteList, getRoutePage } from '@/api/api.js' import { getTaskList, getRoutePage } from '@/api/api.js'
let isShow = ref(false) let isShow = ref(false)
@ -157,24 +163,20 @@ const category = reactive([
// //
let listData = reactive({ let listData = reactive({
page: {// // loadStatus:'loading', //more-loading-nomore-
size: 10, // // isLoadMore:false, //
num: 1, //
},
loadStatus:'loading', //more-loading-nomore-
isLoadMore:false, //
taskList: [ taskList: [
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '已巡检', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '已巡检', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '未巡检', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '未巡检', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
{ title: '左岸白班机组', state: '巡检中', num: 'BHT-YX-XJ-L1.2', info: '白班每班一次,由当班值执行', task: '5/32' }, // { title: '', state: '', num: 'BHT-YX-XJ-L1.2', info: '', task: '5/32' },
]// ]//
}) })
@ -182,20 +184,20 @@ let listData = reactive({
onPullDownRefresh(() => { onPullDownRefresh(() => {
nextTick(() => { nextTick(() => {
console.log('下拉刷新完成'); console.log('下拉刷新完成');
queryList(listData.page) queryList()
// //
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}); });
}) })
// //
onReachBottom(() => { // onReachBottom(() => {
if(!listData.isLoadMore){ // if(!listData.isLoadMore){
listData.isLoadMore = true // listData.isLoadMore = true
listData.filtrate.num += 1 // listData.filtrate.num += 1
queryList(listData.page) // queryList()
} // }
}) // })
// //
onPageScroll((e) => { onPageScroll((e) => {
@ -203,32 +205,19 @@ onPageScroll((e) => {
}); });
onLoad(() => { onLoad(() => {
queryList(listData.page) changeCategory(0) //
}) })
//
const queryList = (data) => { const queryList = (data) => {
console.log(data) console.log(data);
getRoutePage(data).then((res) => {
getTaskList(data).then((res) => {
console.log(res.data); console.log(res.data);
// if(res.records.length!==0){ if (res.code == 200) {
// //10 listData.taskList = res.data
// state.taskList = state.taskList.concat(res.records) }
// //
// if(res.records.length<state.filtrate.size){
// state.isLoadMore=true
// state.loadStatus='nomore'
// }else{
// state.isLoadMore=false
// }
// }else{
// state.isLoadMore=true
// state.loadStatus='nomore'
// }
// if (res.code == 200) {
// listData.taskList = res.data
// }
}).catch((err) => { }).catch((err) => {
}); });
@ -241,20 +230,18 @@ const changeTitle = (index) => {
const changeCategory = (index) => { const changeCategory = (index) => {
categoryCurIndex.value = index categoryCurIndex.value = index
console.log(index);
switch (index) { switch (index) {
case 0:
queryList({})
break;
case 1: case 1:
queryList({ state: 1 }) queryList({ state: '0' })
break; break;
case 2: case 2:
// queryList({ state: 1 }) queryList({ state: '1' })
break; break;
case 3: case 3:
queryList({ state: 0 }) queryList({ state: '2' })
break;
default:
// queryList({})
break; break;
} }
} }
@ -269,11 +256,10 @@ const goToHistory = () => {
// //
const goToStartInspection = (item) => { const goToStartInspection = (item) => {
console.log(item); console.log(item);
// if (item.state == 0) { let mode = item.state == 2 ? 'detail' : 'start'
uni.navigateTo({ uni.navigateTo({
url: `/pages/startInspection/startInspection?data=${JSON.stringify(item)}` url: `/pages/startInspection/startInspection?data=${JSON.stringify(item)}&mode=${mode}`
}); });
// }
} }
@ -475,6 +461,7 @@ const topBack = () => {
} }
} }
} }
</style> </style>

View File

@ -2,7 +2,7 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-19 15:18:26 * @Date: 2025-05-19 15:18:26
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-06-09 17:25:08 * @LastEditTime: 2025-06-11 10:27:18
* @Description: 知识库 * @Description: 知识库
--> -->
<template> <template>
@ -146,11 +146,8 @@ const search = () => {
const changeTitle = (index) => { const changeTitle = (index) => {
titleCurIndex.value = index titleCurIndex.value = index
} }
//
const screening = () => { const screening = () => {
// picker.value.show()
console.log(daDropdownRef.value);
daDropdownRef.value?.handleMenuClick() daDropdownRef.value?.handleMenuClick()
} }

View File

@ -2,7 +2,7 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-19 15:19:14 * @Date: 2025-05-19 15:19:14
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-06-09 15:57:18 * @LastEditTime: 2025-06-12 16:43:08
* @Description: 我的 * @Description: 我的
--> -->
<template> <template>

View File

@ -42,13 +42,13 @@
</view> </view>
<view :class="item.selectedImg ? '' : 'input'" v-if="item.tag"> <view :class="item.selectedImg ? '' : 'input'" v-if="item.tag">
<uni-easyinput class="textarea" type="textarea" v-model="item.described" placeholder="请输入" /> <uni-easyinput class="textarea" type="textarea" v-model="item.described" placeholder="请输入" />
<ImageWatermarkPicker class="picker" v-model="item.imageValue" limit="9" @selectImg="selectImg($event,item)" @change="changeImg($event, item)" :watermark-texts="item.watermarkTexts"></ImageWatermarkPicker> <ImageWatermarkPicker class="picker" v-model="item.imageValue" limit="3" @selectImg="selectImg($event,item)" @change="changeImg($event, item)" :watermark-texts="item.watermarkTexts"></ImageWatermarkPicker>
</view> </view>
<view v-else> <view v-else>
<view class="state"><text>状态</text><uni-data-checkbox class="checkbox" mode="button" v-model="item.radio" :localdata="localdata"></uni-data-checkbox></view> <view class="state"><text>状态</text><uni-data-checkbox class="checkbox" mode="button" v-model="item.radio" :localdata="localdata"></uni-data-checkbox></view>
<view v-if="item.radio != 0"> <view v-if="item.radio != 0">
<view class="described">描述<uni-easyinput class="textarea" type="textarea" v-model="item.described" placeholder="请输入" /></view> <view class="described">描述<uni-easyinput class="textarea" type="textarea" v-model="item.described" placeholder="请输入" /></view>
<view>照片<ImageWatermarkPicker class="picker" v-model="item.imageValue" limit="9" @selectImg="selectImg($event,item)" @change="changeImg($event, item)" :watermark-texts="item.watermarkTexts"></ImageWatermarkPicker></view> <view>照片<ImageWatermarkPicker class="picker" v-model="item.imageValue" limit="3" @selectImg="selectImg($event,item)" @change="changeImg($event, item)" :watermark-texts="item.watermarkTexts"></ImageWatermarkPicker></view>
</view> </view>
</view> </view>
</view> </view>
@ -257,24 +257,24 @@ const history = (val) => {
} }
.input { .input {
.textarea { .textarea {
width: 400rpx; width: 450rpx;
flex: none!important; flex: none!important;
} }
.picker { .picker {
margin-left: 10rpx; margin-left: 10rpx;
:deep(.uni-file-picker__container) { :deep(.uni-file-picker__container) {
width: 580rpx; width: 450rpx;
height: 200rpx; height: 150rpx;
} }
} }
} }
// .warp { :deep(.uni-easyinput__content ) {
// display: block !important; height: 130rpx!important;
// :deep(.uni-file-picker__container) { }
// width: auto !important; :deep(.uni-easyinput__content-textarea) {
// height: auto !important; height: 100rpx;
// } min-height: 100rpx!important;
// } }
.state { .state {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -2,8 +2,8 @@
* @Author: XHC * @Author: XHC
* @Date: 2025-05-23 16:46:57 * @Date: 2025-05-23 16:46:57
* @LastEditors: XHC * @LastEditors: XHC
* @LastEditTime: 2025-06-06 17:41:44 * @LastEditTime: 2025-06-12 10:45:54
* @Description: 开始巡检 * @Description: 开始巡检 || 巡检详情
--> -->
<template> <template>
<view class="startInspection"> <view class="startInspection">
@ -19,7 +19,7 @@
<text class="title">路线名称</text> <text class="title">路线名称</text>
</uni-col> </uni-col>
<uni-col :span="17"> <uni-col :span="17">
<text>{{ infoData.routeName }}</text> <text>{{ infoData.patrolRouteVo?.patrolRoute?.routeName || infoData?.routeName }}</text>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -29,7 +29,7 @@
<text class="title">路线编号</text> <text class="title">路线编号</text>
</uni-col> </uni-col>
<uni-col :span="17"> <uni-col :span="17">
<text>{{ infoData.routeNumber }}</text> <text>{{ infoData.patrolRouteVo?.patrolRoute?.routeNumber }}</text>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -39,7 +39,7 @@
<text class="title">巡检频率</text> <text class="title">巡检频率</text>
</uni-col> </uni-col>
<uni-col :span="17"> <uni-col :span="17">
<text>{{ infoData.frequency }}</text> <text v-if="infoData.patrolRouteVo?.frequencys[0]?.frequencyType">{{ infoData.patrolRouteVo?.frequencys[0]?.frequencyType }}{{ infoData.patrolRouteVo?.frequencys[0]?.frequencyValue }}</text>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -49,17 +49,17 @@
<text class="title">巡检人员</text> <text class="title">巡检人员</text>
</uni-col> </uni-col>
<uni-col :span="17"> <uni-col :span="17">
<text>{{ infoData.patrolPersonnel }}</text> <text>{{ infoData.patrolRouteVo?.patrolRoute?.patrolPersonnel || infoData?.patrollerName }}</text>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
<view class="info-item" v-if="infoData.state == 0"> <view class="info-item" v-if="infoData.mode == 'detail'">
<uni-row :gutter="10"> <uni-row :gutter="10">
<uni-col :span="7"> <uni-col :span="7">
<text class="title">巡检时间</text> <text class="title">巡检时间</text>
</uni-col> </uni-col>
<uni-col :span="17"> <uni-col :span="17">
<text>{{ infoData.modifyTime }}</text> <text>{{ infoData.patrolRouteVo?.patrolRoute?.modifyTime || infoData?.patrolTime }}</text>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -69,7 +69,7 @@
<text class="title">巡检内容</text> <text class="title">巡检内容</text>
</uni-col> </uni-col>
<uni-col :span="17"> <uni-col :span="17">
<text>{{ infoData.patrolDescription }}</text> <text>{{ infoData.patrolRouteVo?.patrolRoute?.patrolDescription }}</text>
</uni-col> </uni-col>
</uni-row> </uni-row>
</view> </view>
@ -78,7 +78,7 @@
<view class="inspection-points"> <view class="inspection-points">
<view class="title"> <view class="title">
<uni-section title="巡检点位:" type="line"><text>3/32</text></uni-section> <uni-section title="巡检点位:" type="line"><text>3/32</text></uni-section>
<uni-icons type="scan" size="26" @click="scanQRCode" v-if="infoData.state != '已巡检'"></uni-icons> <uni-icons type="scan" size="26" @click="scanQRCode" v-if="infoData.mode == 'start'"></uni-icons>
</view> </view>
<view class="list-box"> <view class="list-box">
<view class="list-item" v-for="(item, index) in listData" :key="index" @click="isInspected(item)"> <view class="list-item" v-for="(item, index) in listData" :key="index" @click="isInspected(item)">
@ -102,15 +102,15 @@
</view> </view>
</view> </view>
<button type="primary" class="btn" v-if="infoData.mode == 'start'">保存</button>
</view> </view>
</template> </template>
<script setup> <script setup>
import { onLoad } from "@dcloudio/uni-app"; import { onLoad } from "@dcloudio/uni-app";
import { reactive } from "vue"; import { reactive } from "vue";
import { getPointList } from '@/api/api.js'
//
let infoData = reactive({ let infoData = reactive({
title: '', title: '',
num: '', num: '',
@ -130,26 +130,25 @@ let listData = ref([
]) ])
onLoad((options) => { onLoad((options) => {
infoData = { ...infoData, ...JSON.parse(options.data) } infoData = JSON.parse(options.data)
if (infoData.state == 0) { infoData.mode = options.mode
//
listData.value = infoData.patrolRouteVo?.patrolPoints
console.log(infoData);
//
if (infoData.mode == 'detail' ) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '巡检详情' title: '巡检详情'
}); });
} else { //
} }
queryPointList()
}) })
//
const queryPointList = () => {
getPointList({}).then(res => {
console.log(res.data);
listData.value = res.data
})
}
// //
const isInspected = (item) => { const isInspected = (item) => {
if (infoData.state == '已巡检') { if (infoData.mode == 'detail') {
// //
uni.navigateTo({ uni.navigateTo({
url: `/pages/pointsDetail/pointsDetail?data=${JSON.stringify(item)}` url: `/pages/pointsDetail/pointsDetail?data=${JSON.stringify(item)}`
@ -214,6 +213,7 @@ const scanQRCode = () => {
.inspection-points { .inspection-points {
margin-top: 20rpx; margin-top: 20rpx;
padding-bottom: 80rpx;
.title { .title {
padding-right: 20rpx; padding-right: 20rpx;
display: flex; display: flex;
@ -286,5 +286,10 @@ const scanQRCode = () => {
} }
} }
.btn {
position: fixed;
bottom: 0;
width: 100%;
}
} }
</style> </style>