对接首页部分接口,完善历史巡检
This commit is contained in:
parent
ed7e524b4c
commit
83148c376b
27
src/App.vue
27
src/App.vue
@ -2,7 +2,7 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-19 10:21:48
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-06-09 16:31:54
|
||||
* @LastEditTime: 2025-06-11 17:01:41
|
||||
* @Description:
|
||||
-->
|
||||
<script>
|
||||
@ -23,8 +23,8 @@ export default {
|
||||
@import '@/static/icon/iconfont.css';
|
||||
/*每个页面公共css */
|
||||
// uni-page-body {
|
||||
// padding-bottom:var(--window-bottom)
|
||||
// }
|
||||
// padding-bottom:var(--window-bottom)
|
||||
//}
|
||||
|
||||
#app {
|
||||
background: url('@/static/image/index/bg.png') no-repeat;
|
||||
@ -65,7 +65,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
padding: 10rpx 0;
|
||||
.title {
|
||||
width: 70%;
|
||||
width: 75%;
|
||||
display: inline-block;
|
||||
height: 30rpx;
|
||||
line-height: 30rpx;
|
||||
@ -86,9 +86,8 @@ export default {
|
||||
font-size: 24rpx;
|
||||
.info-text {
|
||||
display: inline-block;
|
||||
width: 70%;
|
||||
|
||||
margin-left: 10rpx;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -137,6 +136,7 @@ export default {
|
||||
|
||||
// 点位卡片
|
||||
.info-card {
|
||||
padding: 30rpx 0;
|
||||
padding-bottom: 30rpx;
|
||||
margin: 0 30rpx;
|
||||
border-radius: 10rpx;
|
||||
@ -145,17 +145,10 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20rpx;
|
||||
font-size: 32rpx;
|
||||
padding: 0 20rpx 20rpx;
|
||||
:deep(.uni-section) {
|
||||
font-weight: 700;
|
||||
// :deep(.uni-section) {
|
||||
// flex: 1;
|
||||
// margin-right: 20rpx;
|
||||
// .title {
|
||||
// font-size: 32rpx;
|
||||
// color: #0A61B9;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
.info-box {
|
||||
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;
|
||||
border-color: #004894!important;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: xhc
|
||||
* @Date: 2025-05-19 10:44:34
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-06-03 14:07:17
|
||||
* @LastEditTime: 2025-06-12 10:30:25
|
||||
* @FilePath: \bht-app\src\api\api.js
|
||||
* @Description: api
|
||||
*/
|
||||
@ -18,7 +18,12 @@ export const getRoutePage = () => {
|
||||
return http('/bht/patrolRoute/findPage', 'post')
|
||||
}
|
||||
|
||||
// 查询点位路线
|
||||
export const getPointList = () => {
|
||||
return http('/bht/patrolPoint/findList', 'post')
|
||||
// 查询巡检任务列表
|
||||
export const getTaskList = (data) => {
|
||||
return http('/bht/patrolTask/findList', 'post', data)
|
||||
}
|
||||
|
||||
// 巡检记录列表查询
|
||||
export const getRecordList = (data) => {
|
||||
return http('/bht/patrolRecord/findPage', 'post', data)
|
||||
}
|
||||
|
@ -581,7 +581,7 @@ export default defineComponent({
|
||||
handlePopupMask,
|
||||
handleMove,
|
||||
getMenuValue,
|
||||
|
||||
closeMenuPopup,
|
||||
handleCellSelect,
|
||||
handleFilterConfirm,
|
||||
handlePickerConfirm,
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-19 10:42:57
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-05-28 14:00:10
|
||||
* @LastEditTime: 2025-06-11 09:28:34
|
||||
* @Description:
|
||||
*/
|
||||
let baseUrl
|
||||
|
@ -4,7 +4,6 @@
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "知识库",
|
||||
"enablePullDownRefresh": true,
|
||||
"onReachBottomDistance": 100
|
||||
}
|
||||
@ -54,7 +53,21 @@
|
||||
{
|
||||
"path": "pages/points/points",
|
||||
"style": {
|
||||
"navigationBarTitleText": "巡检点位"
|
||||
"navigationBarTitleText": "巡检点位",
|
||||
"app-plus": {
|
||||
"titleNView": {
|
||||
"buttons": [
|
||||
{
|
||||
"text": "保存",
|
||||
"type": "none",
|
||||
"colorPressed": "#158EF8",
|
||||
"color": "#fff",
|
||||
"fontSize": "16px"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-23 15:29:20
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-05-23 16:28:13
|
||||
* @LastEditTime: 2025-06-12 16:08:37
|
||||
* @Description: 历史巡检
|
||||
-->
|
||||
<template>
|
||||
@ -13,40 +13,187 @@
|
||||
<uni-search-bar class="search" radius="15" bgColor="#EDF4FD" placeholder="搜索线路名称" clearButton="auto" cancelButton="none" @confirm="search" />
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="screening"><uni-icons fontFamily="iconfont" color="#fff" :size="20">{{''}}</uni-icons></view>
|
||||
<view class="screening" @click="screening"><uni-icons fontFamily="iconfont" color="#fff" :size="20">{{''}}</uni-icons></view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</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">
|
||||
<text class="title">{{ item.title }}</text>
|
||||
<uni-tag :inverted="true" :text="item.state" :type="item.state == '异常' ? 'warning' : 'success'" />
|
||||
<text class="title">{{ item.routeName }}</text>
|
||||
<uni-tag :inverted="true" :text="item.inspectionResult" :type="item.inspectionResult == '异常' ? 'warning' : 'success'" />
|
||||
</view>
|
||||
<view class="num grey">线路编号:{{ item.num }}</view>
|
||||
<view class="info-box grey">
|
||||
<view class="info"><uni-icons fontFamily="iconfont" color="#1469BC">{{''}}</uni-icons> {{ item.info }}</view>
|
||||
<view class="info"><uni-icons fontFamily="iconfont" color="#808185">{{''}}</uni-icons> <text>{{ item.time }}</text></view>
|
||||
<view class="info"><uni-icons fontFamily="iconfont" color="#1469BC">{{''}}</uni-icons> {{ item.deptName }}</view>
|
||||
<view class="info"><uni-icons fontFamily="iconfont" color="#808185">{{''}}</uni-icons> <text>{{ item.patrolTime }}</text></view>
|
||||
</view>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
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([
|
||||
{ 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' },
|
||||
let listData = reactive({
|
||||
page: {
|
||||
pageSize: 10, //每页条数
|
||||
pageNum: 1, //当前页码
|
||||
},
|
||||
loadStatus:'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
||||
isLoadMore:false, //是否加载中
|
||||
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' },
|
||||
]
|
||||
|
||||
})
|
||||
|
||||
const daDropdownRef = ref(null)
|
||||
const menuVal = reactive({
|
||||
datetimesingle: []
|
||||
})
|
||||
const dropdownMenuList = ref([
|
||||
{
|
||||
title: '插槽',
|
||||
type: 'slot3',
|
||||
prop: 'god3',
|
||||
// 默认选中单选2、多选2、3、滑动30
|
||||
// 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 = () => {
|
||||
|
||||
@ -64,5 +211,40 @@ const search = () => {
|
||||
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>
|
@ -2,7 +2,7 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-19 11:07:37
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-06-09 09:40:25
|
||||
* @LastEditTime: 2025-06-12 11:01:27
|
||||
* @Description: 首页
|
||||
-->
|
||||
<template>
|
||||
@ -31,7 +31,7 @@
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-if="navCurIndex == 0">
|
||||
<view>
|
||||
<uni-card :is-shadow="false" class="patrol-card" >
|
||||
<view class="time">巡检时间:<text>{{ patrolData.time }}</text></view>
|
||||
<view class="card-info">
|
||||
@ -82,28 +82,34 @@
|
||||
<view>
|
||||
<uni-card class="list-card" v-for="(item, index) in listData.taskList" :key="index" @click="goToStartInspection(item)">
|
||||
<view class="head">
|
||||
<text class="title">{{ item.title }}</text>
|
||||
<!-- <uni-tag :inverted="true" :text="item.state == 0 ? '已巡检' : '未巡检'" :type="item.state == 0 ? 'success' : 'error'" /> -->
|
||||
<uni-tag :inverted="true" :text="item.state" :type="item.state == '已巡检' ? 'success' : 'error'" />
|
||||
<text class="title">{{ item.patrolRouteVo.patrolRoute?.routeName }}</text>
|
||||
<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.patrolTask.state" :type="item.state == '已巡检' ? 'success' : 'error'" /> -->
|
||||
</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"> <uni-icons fontFamily="iconfont" color="#808185">{{''}}</uni-icons> {{ item.info }}</view>
|
||||
<!-- <uni-row :gutter="20">
|
||||
<uni-col :span="18"> -->
|
||||
<view class="info"> <uni-icons fontFamily="iconfont" color="#808185">{{''}}</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>
|
||||
<!-- </uni-col> -->
|
||||
<!-- </uni-row> -->
|
||||
</view>
|
||||
</uni-card>
|
||||
<view v-if="listData.isLoadMore">
|
||||
<!-- <view v-if="listData.isLoadMore">
|
||||
<uni-load-more :status="listData.loadStatus" ></uni-load-more>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- <view v-if="categoryCurIndex == 1"></view>
|
||||
<view v-if="categoryCurIndex == 2"></view>
|
||||
<view v-if="categoryCurIndex == 3"></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 == 3">保护分部</view>
|
||||
<view v-if="navCurIndex == 3">保护分部</view> -->
|
||||
</view>
|
||||
<!-- 回到顶部 -->
|
||||
<view class="top-back" @click="topBack" v-if="isShow">
|
||||
@ -117,7 +123,7 @@
|
||||
import { nextTick, onMounted, reactive, ref } from "vue";
|
||||
import { onReachBottom, onLoad, onShow, onPullDownRefresh, onPageScroll } from "@dcloudio/uni-app";
|
||||
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)
|
||||
@ -157,24 +163,20 @@ const category = reactive([
|
||||
|
||||
// 列表数据
|
||||
let listData = reactive({
|
||||
page: {//请求参数
|
||||
size: 10, // 条数
|
||||
num: 1, // 页数
|
||||
},
|
||||
loadStatus:'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
||||
isLoadMore:false, //是否加载中
|
||||
// loadStatus:'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
|
||||
// isLoadMore:false, //是否加载中
|
||||
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(() => {
|
||||
nextTick(() => {
|
||||
console.log('下拉刷新完成');
|
||||
queryList(listData.page)
|
||||
queryList()
|
||||
// 停止下拉刷新动画
|
||||
uni.stopPullDownRefresh();
|
||||
});
|
||||
})
|
||||
|
||||
//上拉触底
|
||||
onReachBottom(() => {
|
||||
if(!listData.isLoadMore){
|
||||
listData.isLoadMore = true
|
||||
listData.filtrate.num += 1
|
||||
queryList(listData.page)
|
||||
}
|
||||
})
|
||||
// onReachBottom(() => {
|
||||
// if(!listData.isLoadMore){
|
||||
// listData.isLoadMore = true
|
||||
// listData.filtrate.num += 1
|
||||
// queryList()
|
||||
// }
|
||||
// })
|
||||
|
||||
// 根据滚动距离以推断是否有显示返回顶部功能
|
||||
onPageScroll((e) => {
|
||||
@ -203,32 +205,19 @@ onPageScroll((e) => {
|
||||
});
|
||||
|
||||
onLoad(() => {
|
||||
queryList(listData.page)
|
||||
changeCategory(0) // 默认加载全部巡检任务
|
||||
})
|
||||
|
||||
// 获取巡检任务列表
|
||||
const queryList = (data) => {
|
||||
console.log(data)
|
||||
getRoutePage(data).then((res) => {
|
||||
console.log(data);
|
||||
|
||||
getTaskList(data).then((res) => {
|
||||
console.log(res.data);
|
||||
|
||||
// if(res.records.length!==0){
|
||||
// //首次加载10条数据,后进行拼接
|
||||
// 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
|
||||
// }
|
||||
if (res.code == 200) {
|
||||
listData.taskList = res.data
|
||||
}
|
||||
}).catch((err) => {
|
||||
|
||||
});
|
||||
@ -241,20 +230,18 @@ const changeTitle = (index) => {
|
||||
|
||||
const changeCategory = (index) => {
|
||||
categoryCurIndex.value = index
|
||||
console.log(index);
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
queryList({})
|
||||
break;
|
||||
case 1:
|
||||
queryList({ state: 1 })
|
||||
queryList({ state: '0' })
|
||||
break;
|
||||
case 2:
|
||||
// queryList({ state: 1 })
|
||||
queryList({ state: '1' })
|
||||
break;
|
||||
case 3:
|
||||
queryList({ state: 0 })
|
||||
break;
|
||||
default:
|
||||
// queryList({})
|
||||
queryList({ state: '2' })
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -269,11 +256,10 @@ const goToHistory = () => {
|
||||
// 列表跳转
|
||||
const goToStartInspection = (item) => {
|
||||
console.log(item);
|
||||
// if (item.state == 0) {
|
||||
let mode = item.state == 2 ? 'detail' : 'start'
|
||||
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>
|
@ -2,7 +2,7 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-19 15:18:26
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-06-09 17:25:08
|
||||
* @LastEditTime: 2025-06-11 10:27:18
|
||||
* @Description: 知识库
|
||||
-->
|
||||
<template>
|
||||
@ -146,11 +146,8 @@ const search = () => {
|
||||
const changeTitle = (index) => {
|
||||
titleCurIndex.value = index
|
||||
}
|
||||
|
||||
// 筛选
|
||||
const screening = () => {
|
||||
// picker.value.show()
|
||||
console.log(daDropdownRef.value);
|
||||
|
||||
daDropdownRef.value?.handleMenuClick()
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-19 15:19:14
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-06-09 15:57:18
|
||||
* @LastEditTime: 2025-06-12 16:43:08
|
||||
* @Description: 我的
|
||||
-->
|
||||
<template>
|
||||
|
@ -42,13 +42,13 @@
|
||||
</view>
|
||||
<view :class="item.selectedImg ? '' : 'input'" v-if="item.tag">
|
||||
<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 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 v-if="item.radio != 0">
|
||||
<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>
|
||||
@ -257,24 +257,24 @@ const history = (val) => {
|
||||
}
|
||||
.input {
|
||||
.textarea {
|
||||
width: 400rpx;
|
||||
width: 450rpx;
|
||||
flex: none!important;
|
||||
}
|
||||
.picker {
|
||||
margin-left: 10rpx;
|
||||
:deep(.uni-file-picker__container) {
|
||||
width: 580rpx;
|
||||
height: 200rpx;
|
||||
width: 450rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
// .warp {
|
||||
// display: block !important;
|
||||
// :deep(.uni-file-picker__container) {
|
||||
// width: auto !important;
|
||||
// height: auto !important;
|
||||
// }
|
||||
// }
|
||||
:deep(.uni-easyinput__content ) {
|
||||
height: 130rpx!important;
|
||||
}
|
||||
:deep(.uni-easyinput__content-textarea) {
|
||||
height: 100rpx;
|
||||
min-height: 100rpx!important;
|
||||
}
|
||||
.state {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -2,8 +2,8 @@
|
||||
* @Author: XHC
|
||||
* @Date: 2025-05-23 16:46:57
|
||||
* @LastEditors: XHC
|
||||
* @LastEditTime: 2025-06-06 17:41:44
|
||||
* @Description: 开始巡检
|
||||
* @LastEditTime: 2025-06-12 10:45:54
|
||||
* @Description: 开始巡检 || 巡检详情
|
||||
-->
|
||||
<template>
|
||||
<view class="startInspection">
|
||||
@ -19,7 +19,7 @@
|
||||
<text class="title">路线名称:</text>
|
||||
</uni-col>
|
||||
<uni-col :span="17">
|
||||
<text>{{ infoData.routeName }}</text>
|
||||
<text>{{ infoData.patrolRouteVo?.patrolRoute?.routeName || infoData?.routeName }}</text>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
@ -29,7 +29,7 @@
|
||||
<text class="title">路线编号:</text>
|
||||
</uni-col>
|
||||
<uni-col :span="17">
|
||||
<text>{{ infoData.routeNumber }}</text>
|
||||
<text>{{ infoData.patrolRouteVo?.patrolRoute?.routeNumber }}</text>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
@ -39,7 +39,7 @@
|
||||
<text class="title">巡检频率:</text>
|
||||
</uni-col>
|
||||
<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-row>
|
||||
</view>
|
||||
@ -49,17 +49,17 @@
|
||||
<text class="title">巡检人员:</text>
|
||||
</uni-col>
|
||||
<uni-col :span="17">
|
||||
<text>{{ infoData.patrolPersonnel }}</text>
|
||||
<text>{{ infoData.patrolRouteVo?.patrolRoute?.patrolPersonnel || infoData?.patrollerName }}</text>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<view class="info-item" v-if="infoData.state == 0">
|
||||
<view class="info-item" v-if="infoData.mode == 'detail'">
|
||||
<uni-row :gutter="10">
|
||||
<uni-col :span="7">
|
||||
<text class="title">巡检时间:</text>
|
||||
</uni-col>
|
||||
<uni-col :span="17">
|
||||
<text>{{ infoData.modifyTime }}</text>
|
||||
<text>{{ infoData.patrolRouteVo?.patrolRoute?.modifyTime || infoData?.patrolTime }}</text>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
@ -69,7 +69,7 @@
|
||||
<text class="title">巡检内容:</text>
|
||||
</uni-col>
|
||||
<uni-col :span="17">
|
||||
<text>{{ infoData.patrolDescription }}</text>
|
||||
<text>{{ infoData.patrolRouteVo?.patrolRoute?.patrolDescription }}</text>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
@ -78,7 +78,7 @@
|
||||
<view class="inspection-points">
|
||||
<view class="title">
|
||||
<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 class="list-box">
|
||||
<view class="list-item" v-for="(item, index) in listData" :key="index" @click="isInspected(item)">
|
||||
@ -102,15 +102,15 @@
|
||||
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="btn" v-if="infoData.mode == 'start'">保存</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { reactive } from "vue";
|
||||
import { getPointList } from '@/api/api.js'
|
||||
|
||||
// 巡检信息
|
||||
let infoData = reactive({
|
||||
title: '',
|
||||
num: '',
|
||||
@ -130,26 +130,25 @@ let listData = ref([
|
||||
])
|
||||
|
||||
onLoad((options) => {
|
||||
infoData = { ...infoData, ...JSON.parse(options.data) }
|
||||
if (infoData.state == 0) {
|
||||
infoData = JSON.parse(options.data)
|
||||
infoData.mode = options.mode
|
||||
// 点位数据
|
||||
listData.value = infoData.patrolRouteVo?.patrolPoints
|
||||
console.log(infoData);
|
||||
// 巡检详情
|
||||
if (infoData.mode == 'detail' ) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '巡检详情'
|
||||
});
|
||||
} else { // 开始巡检
|
||||
}
|
||||
queryPointList()
|
||||
|
||||
})
|
||||
|
||||
// 查询点位列表
|
||||
const queryPointList = () => {
|
||||
getPointList({}).then(res => {
|
||||
console.log(res.data);
|
||||
listData.value = res.data
|
||||
})
|
||||
}
|
||||
|
||||
// 判断是否已巡检
|
||||
const isInspected = (item) => {
|
||||
if (infoData.state == '已巡检') {
|
||||
if (infoData.mode == 'detail') {
|
||||
// 跳转到点位详情页面
|
||||
uni.navigateTo({
|
||||
url: `/pages/pointsDetail/pointsDetail?data=${JSON.stringify(item)}`
|
||||
@ -214,6 +213,7 @@ const scanQRCode = () => {
|
||||
|
||||
.inspection-points {
|
||||
margin-top: 20rpx;
|
||||
padding-bottom: 80rpx;
|
||||
.title {
|
||||
padding-right: 20rpx;
|
||||
display: flex;
|
||||
@ -286,5 +286,10 @@ const scanQRCode = () => {
|
||||
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user