新增的功能

master
xielei 2024-10-31 17:39:30 +08:00
parent 1c65d9c8a3
commit d63ffc1e9e
7 changed files with 311 additions and 274 deletions

View File

@ -1,6 +1,6 @@
<template> <template>
<view :style="{height:'100vh',overflow:'hidden',backgroundColor:'#f0f0f0'}"> <view :style="{height:'100vh',overflow:'hidden',backgroundColor:'#f0f0f0'}">
<u-navbar title="小玉潭水库" :autoBack="true" :titleStyle="{ <u-navbar title="小玉潭水库1" :autoBack="true" :titleStyle="{
fontSize:'18px' fontSize:'18px'
}" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> }" :height='44' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar> </u-navbar>
@ -47,8 +47,9 @@
}] }]
}; };
}, },
mounted() { onLoad() {
console.log('小玉潭水库');
this.getList()
}, },
methods: { methods: {
click(item) { click(item) {
@ -58,11 +59,11 @@
console.log(e); console.log(e);
this.nowNum = e.current+1 this.nowNum = e.current+1
}, },
// getList(){ getList(){
// uni.$http.post('/gunshiApp/xyt/stQxWarnR/home/warn',this.model).then(res=>{ uni.$http.post('/gunshiApp/xyt/attResBase/list',this.model).then(res=>{
console.log(res,'res');
// }) })
// }, },
confirm(e) { confirm(e) {
console.log(e); console.log(e);
this.model.start = e[0] this.model.start = e[0]

View File

@ -3,10 +3,10 @@
<view class="title"> <view class="title">
<view class="left"> <view class="left">
<u-icon name="file-text" color="origin"></u-icon> <u-icon name="file-text" color="origin"></u-icon>
<text>小玉潭水库</text> <text>{{dataform.resName}}</text>
</view> </view>
<view class="right"> <view class="right">
2024-08-12 11:00 {{tm}}
</view> </view>
</view> </view>
<view class="content"> <view class="content">
@ -37,42 +37,55 @@
</template> </template>
<script> <script>
import moment from 'moment'
export default{ export default{
data(){ data(){
return{ return{
list:{ list:{
1:'当前水位m', 1:'当前水位m',
2:'今日雨量mm', 2:'今日雨量mm',
3:'汛限水位m', 'flLowLimLev':'汛限水位m',
4:'比汛期m', 4:'比汛期m',
5:'堰顶高程m', 'wcrstel':'堰顶高程m',
6:'坝顶高程m', 'crestElev':'坝顶高程m',
7:'24h预报', 7:'24h预报',
8:'昨日雨量', 8:'昨日雨量',
9:'总库容m³', 'totCap':'总库容m³',
10:'蓄水量万m³' 10:'蓄水量万m³'
}, },
tm: moment().format('YYYY-MM-DD HH:mm:ss'),
dataform:{ dataform:{
1:192.41, // resName:'',
2:112, // 1:192.41,
3:194.00, // 2:112,
4:-1.59, // 3:194.00,
5:194.00, // 4:-1.59,
6:196.28, // 5:194.00,
7:12, // 6:196.28,
8:15.4, // 7:12,
9:129.06, // 8:15.4,
10:75.34 // 9:129.06,
// 10:75.34
} }
} }
}, },
mounted() {
console.log('小玉潭水库222');
this.getList()
},
methods:{ methods:{
toDetail(){ toDetail(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/skInfo/detail/index' url:'/pages/skInfo/detail/index'
}) })
} },
getList(){
uni.$http.post('/gunshiApp/xyt/attResBase/list').then(res=>{
console.log(res.data.data[0]);
this.dataform=res.data.data[0]
})
},
} }
} }
</script> </script>

View File

@ -1,15 +1,10 @@
<template> <template>
<view class="contentItem"> <view class="contentItem">
<uni-collapse > <uni-collapse>
<uni-collapse-item <uni-collapse-item title-border="none" v-for="(item,index) in listData" :key="index" :border="false"
title-border="none" :show-animation="true">
v-for="(item,index) in listData" <template v-slot:title>
:key="index"
:border="false"
:show-animation="true"
>
<template v-slot:title >
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<text class="yuandian"></text> <text class="yuandian"></text>
<text>{{item.name}}</text> <text>{{item.name}}</text>
@ -21,62 +16,54 @@
<text>{{o.itemDesc}}</text> <text>{{o.itemDesc}}</text>
<view class="subsectioin"> <view class="subsectioin">
<u--form labelPosition="left" :model="o" ref="uForm"> <u--form labelPosition="left" :model="o" ref="uForm">
<u-form-item label="状态" prop="isNormal" borderBottom <u-form-item label="状态" prop="isNormal" borderBottom required>
required> <u-subsection :list="list" :current="getNormal(o.isNormal)" mode="subsection"
<u-subsection
:list="list"
:current="getNormal(o.isNormal)"
mode="subsection"
@change="(e)=>change(e,o,index,i,'isNormal')" @change="(e)=>change(e,o,index,i,'isNormal')"
style="width:200px;margin-left: 10px" style="width:200px;margin-left: 10px"></u-subsection>
></u-subsection>
</u-form-item> </u-form-item>
<view class="" v-if="o.isNormal"> <view class="" v-if="o.isNormal">
<u-form-item label="现场图片" prop="inspectPics" borderBottom <u-form-item label="现场图片" prop="inspectPics" borderBottom required>
required> <u-upload accept="image" :fileList="o.inspectPics"
<u-upload accept="image" :fileList="o.inspectPics" @afterRead="(e)=>afterRead(e,o,index,i)" @delete="(e)=>deletePic(e,o,index,i)" name="inspectPics" multiple @afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="inspectPics" multiple
:maxCount="10"></u-upload> :maxCount="10"></u-upload>
</u-form-item> </u-form-item>
<u-form-item label="现场视频" prop="inspectVideos" borderBottom <u-form-item label="现场视频" prop="inspectVideos" borderBottom>
> <u-upload accept="video" :fileList="o.inspectVideos"
<u-upload accept="video" :fileList="o.inspectVideos" @afterRead="(e)=>afterRead(e,o,index,i)" @delete="(e)=>deletePic(e,o,index,i)" name="inspectVideos" multiple @afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="inspectVideos" multiple
:maxCount="10"></u-upload> :maxCount="10"></u-upload>
</u-form-item> </u-form-item>
<u-form-item label="问题描述" prop="itemProblemDesc" borderBottom <u-form-item label="问题描述" prop="itemProblemDesc" borderBottom required>
required>
<u--textarea v-model="o.itemProblemDesc" placeholder="请输入内容"></u--textarea> <u--textarea v-model="o.itemProblemDesc" placeholder="请输入内容"></u--textarea>
</u-form-item> </u-form-item>
<u-form-item label="处理状态" prop="isHandle" borderBottom <u-form-item label="处理状态" prop="isHandle" borderBottom required>
required> <u-subsection :list="listStatus" :current="getHandle(o.isHandle)"
<u-subsection mode="subsection" @change="(e)=>change(e,o,index,i,'isHandle')"
:list="listStatus" style="width:200px;margin-left: 10px"></u-subsection>
:current="getHandle(o.isHandle)"
mode="subsection"
@change="(e)=>change(e,o,index,i,'isHandle')"
style="width:200px;margin-left: 10px"
></u-subsection>
</u-form-item> </u-form-item>
<view class="" v-if="o.isHandle !== 1"> <view class="" v-if="o.isHandle !== 1">
<u-form-item label="现场图片" prop="handlePics" borderBottom <u-form-item label="现场图片" prop="handlePics" borderBottom required>
required> <u-upload accept="image" :fileList="o.handlePics"
<u-upload accept="image" :fileList="o.handlePics" @afterRead="(e)=>afterRead(e,o,index,i)" @delete="(e)=>deletePic(e,o,index,i)" name="handlePics" multiple @afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="handlePics" multiple
:maxCount="10"></u-upload> :maxCount="10"></u-upload>
</u-form-item> </u-form-item>
<u-form-item label="现场视频" prop="handleVideos" borderBottom <u-form-item label="现场视频" prop="handleVideos" borderBottom>
> <u-upload accept="video" :fileList="o.handleVideos"
<u-upload accept="video" :fileList="o.handleVideos" @afterRead="(e)=>afterRead(e,o,index,i)" @delete="(e)=>deletePic(e,o,index,i)" name="handleVideos" multiple @afterRead="(e)=>afterRead(e,o,index,i)"
@delete="(e)=>deletePic(e,o,index,i)" name="handleVideos" multiple
:maxCount="10"></u-upload> :maxCount="10"></u-upload>
</u-form-item> </u-form-item>
<u-form-item label="问题描述" prop="handleDesc" borderBottom <u-form-item label="问题描述" prop="handleDesc" borderBottom required>
required>
<u--textarea v-model="o.handleDesc" placeholder="请输入内容"></u--textarea> <u--textarea v-model="o.handleDesc" placeholder="请输入内容"></u--textarea>
</u-form-item> </u-form-item>
</view> </view>
<view class="" v-if="o.isHandle == 1"> <view class="" v-if="o.isHandle == 1">
<u-form-item label="责任人" prop="handleUserId" borderBottom @click="showSex = true; hideKeyboard()" required <u-form-item label="责任人" prop="handleUserId" borderBottom
> @click="showSex = true; hideKeyboard()" required>
<u--input v-model="o.handleUserId" disabled disabledColor="#ffffff" placeholder="请选择性别" <u--input v-model="o.handleUserId" disabled disabledColor="#ffffff"
border="none"></u--input> placeholder="请选择性别" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon> <u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item> </u-form-item>
@ -89,25 +76,29 @@
</view> </view>
</view> </view>
</view> </view>
</uni-collapse-item > </uni-collapse-item>
<view class="" style="display: flex;">
</uni-collapse> <u-button text="保存" customStyle="margin-top: 50px" @click="submit"></u-button>
<u-button type="primary" text="结束巡检" customStyle="margin-top: 50px" @click="submit"></u-button> <u-button type="primary" text="结束巡检" customStyle="margin-top: 50px" @click="submit"></u-button>
</view> </view>
</uni-collapse>
</view>
</template> </template>
<script> <script>
export default{ export default {
props:{ props: {
xjItem:Array xjItem: Array
}, },
data(){ data() {
return{ return {
list:["正常","异常"], list: ["正常", "异常"],
listStatus:["已处理","未处理"], listStatus: ["已处理", "未处理"],
current:0, current: 0,
listData:[], listData: [],
showSex:false, showSex: false,
actions: [{ actions: [{
name: '男', name: '男',
}, },
@ -123,114 +114,113 @@
mounted() { mounted() {
// this.listData = this.xjItem // this.listData = this.xjItem
}, },
watch:{ watch: {
xjItem:function(n,o){ xjItem: function(n, o) {
this.listData = n.map(item=>{ this.listData = n.map(item => {
item.childen=item.children.map(i=>{ item.childen = item.children.map(i => {
if(!i.handlePics){ if (!i.handlePics) {
i.handlePics=[] i.handlePics = []
} }
if(!i.handleVideos){ if (!i.handleVideos) {
i.handleVideos=[] i.handleVideos = []
} }
if(!i.inspectPics){ if (!i.inspectPics) {
i.inspectPics=[] i.inspectPics = []
} }
if(!i.inspectVideos){ if (!i.inspectVideos) {
i.inspectVideos=[] i.inspectVideos = []
} }
return i return i
}) })
return item return item
}) })
console.log(n,this.listData,'this.listData '); console.log(n, this.listData, 'this.listData ');
} }
}, },
methods:{ methods: {
getIsItem(arr){ getIsItem(arr) {
return arr.filter(item1=> item1.isNormal!==1 && item1.isNormal!==0).length return arr.filter(item1 => item1.isNormal !== 1 && item1.isNormal !== 0).length
}, },
getNormal(isNormal){ getNormal(isNormal) {
if(isNormal == 0){ if (isNormal == 0) {
return 0 return 0
} }
if(isNormal == 1){ if (isNormal == 1) {
return 1 return 1
} }
if(isNormal == null){ if (isNormal == null) {
return 3 return 3
} }
}, },
getHandle(isHandle){ getHandle(isHandle) {
if(isHandle == 0){ if (isHandle == 0) {
return 0 return 0
} }
if(isHandle == 1){ if (isHandle == 1) {
return 1 return 1
} }
if(isHandle == null){ if (isHandle == null) {
return 3 return 3
} }
}, },
async uploadContent(){ async uploadContent() {
try { try {
let params={ let params = {
status:2, status: 2,
list:[] list: []
} }
this.listData.map(i=>{ this.listData.map(i => {
params.list.push(i.children) params.list.push(i.children)
}) })
const {data} = await uni.$http.post(`/gunshiApp/xyt/inspect/task/finish`,params) const {
if(data.code == 200){ data
this.xjItem = data.data } = await uni.$http.post(`/gunshiApp/xyt/inspect/task/finish`, params)
}
} catch (error) { } catch (error) {
uni.$showMsg(); uni.$showMsg();
} }
}, },
submit() { submit() {
let tigger =true let tigger = true
// //
this.listData.forEach(item=>{ this.listData.forEach(item => {
item.ab = item.children.filter(i=>{ item.ab = item.children.filter(i => {
if(i.isNormal ==1){ if (i.isNormal == 1) {
if(i.inspectPics?.length && i.itemProblemDesc){ if (i.inspectPics?.length && i.itemProblemDesc) {
tigger=true tigger = true
}else{ } else {
tigger=false tigger = false
} }
if(i.isHandle ==0){ if (i.isHandle == 0) {
if(i.handlePics?.length && i.handleDesc){ if (i.handlePics?.length && i.handleDesc) {
tigger=true tigger = true
}else{ } else {
tigger=false tigger = false
} }
}else if(i.isHandle ==1){ } else if (i.isHandle == 1) {
tigger=true tigger = true
} }
}else if(i.isNormal == 0){ } else if (i.isNormal == 0) {
tigger=true tigger = true
} }
}) })
return item return item
}) })
console.log(tigger,'arr'); console.log(tigger, 'arr');
if(tigger){ if (tigger) {
this.uploadContent() this.uploadContent()
} }
// //
// if() // if()
}, },
// //
deletePic(event,o,index,index1) { deletePic(event, o, index, index1) {
this.listData[index].children[index1][event.name].splice(event.index, 1) this.listData[index].children[index1][event.name].splice(event.index, 1)
}, },
// //
async afterRead(event,o,index,index1) { async afterRead(event, o, index, index1) {
console.log(event,index1,this.listData[index]); console.log(event, index1, this.listData[index]);
// let file // let file
// multiple true , file // multiple true , file
let lists = [].concat(event.file) let lists = [].concat(event.file)
@ -243,7 +233,7 @@
}) })
}) })
for (let i = 0; i < lists.length; i++) { for (let i = 0; i < lists.length; i++) {
const result = await this.uploadFilePromise(lists[i].url,event.name,index,index1) const result = await this.uploadFilePromise(lists[i].url, event.name, index, index1)
console.log(result); console.log(result);
let item = this.listData[index].children[index1][event.name][fileListLen] let item = this.listData[index].children[index1][event.name][fileListLen]
this.listData[index].children[index1][event.name].splice(fileListLen, 1, Object.assign(item, { this.listData[index].children[index1][event.name].splice(fileListLen, 1, Object.assign(item, {
@ -254,7 +244,7 @@
fileListLen++ fileListLen++
} }
}, },
uploadFilePromise(url,name,index,index1) { uploadFilePromise(url, name, index, index1) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let a = uni.uploadFile({ let a = uni.uploadFile({
url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', // url: 'http://local.gunshiiot.com:18083/gunshiApp/xyt/maintain/service/file/upload/singleSimple', //
@ -274,7 +264,7 @@
// resolve(a) // resolve(a)
}) })
}, },
change(e,o,index,i,key){ change(e, o, index, i, key) {
this.listData[index].children[i][key] = e; this.listData[index].children[i][key] = e;
this.$forceUpdate() this.$forceUpdate()
@ -288,10 +278,11 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.contentItem{ .contentItem {
height: 260px; height: 260px;
overflow: auto; overflow: auto;
.itemC{
.itemC {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
display: flex; display: flex;
@ -299,21 +290,24 @@
padding: 10px; padding: 10px;
border-bottom: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0;
} }
.itemNo{
.itemNo {
color: #666666; color: #666666;
padding: 10px; padding: 10px;
} }
} }
.circle-btn{
.circle-btn {
width: 120px; width: 120px;
height: 120px; height: 120px;
background-color: #007aff; background-color: #007aff;
border-radius: 50%; border-radius: 50%;
color:#fff; color: #fff;
text-align: center; text-align: center;
line-height: 120px; line-height: 120px;
} }
.yuandian{
.yuandian {
display: inline-block; display: inline-block;
width: 10px; width: 10px;
height: 10px; height: 10px;
@ -321,15 +315,18 @@
border-radius: 50%; border-radius: 50%;
margin-right: 10px; margin-right: 10px;
} }
.xj-content{
.xj-content {
height: 300px; height: 300px;
overflow-y: auto; overflow-y: auto;
} }
.xj-text{
.xj-text {
margin-left: 10%; margin-left: 10%;
margin-top: 2%; margin-top: 2%;
} }
.subsectioin{
.subsectioin {
display: flex; display: flex;
column-gap: 10px; column-gap: 10px;
align-items: center; align-items: center;

View File

@ -9,17 +9,17 @@
<view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;"> <view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item"> <view class="item">
<!-- {{item.title}} --> <!-- {{item.title}} -->
<image src="../../../static/c1.png" style="width:100%;"></image> <image :src="item.imgPath" style="width:100%;"></image>
<view class="context"> <view class="context">
<view class="type"> <view class="type">
工程车辆识别 {{typeObj[item.type]}}
</view> </view>
<view class="time"> <view class="time">
{{item.time}} {{item.tm}}
</view> </view>
</view> </view>
<view class="adress"> <view class="adress">
大坝右岸 {{item.name}}
</view> </view>
</view> </view>
</view> </view>
@ -36,6 +36,12 @@
data() { data() {
return { return {
show: false, show: false,
typeObj:{
1:"人员闯入",
2: "工程车辆识别",
3: "漂浮物识别",
4: "游泳识别",
},
model: { model: {
stm: '', stm: '',
etm: '' etm: ''
@ -61,9 +67,12 @@
}; };
}, },
onLoad(options){ onLoad(options){
// this.list = JSON.parse(decodeURIComponent(options.arr)) this.list = JSON.parse(decodeURIComponent(options.arr))
}, },
methods: { methods: {
getType(type){
},
confirm(e) { confirm(e) {
console.log(e); console.log(e);
this.model.stm = e[0] this.model.stm = e[0]

View File

@ -14,18 +14,18 @@
<image src="../../../static/c1.png" style="width: 79px;height: 68px;"></image> <image src="../../../static/c1.png" style="width: 79px;height: 68px;"></image>
<view class=""> <view class="">
<view class="title"> <view class="title">
麻城市气象台发布暴雨橙色预警 {{item.title}}
</view> </view>
<view class=title> <view class=title>
[Ⅱ级/严重] [Ⅱ级/严重]
</view> </view>
<view class="time"> <view class="time">
2024-06-23 15:18:42 {{item.tm}}
</view> </view>
</view> </view>
</view> </view>
<view class="content"> <view class="content">
麻城市2024年06月23日03时18分42秒发布暴雨橙色预警信号过去3小时麻城市乘马岗镇汪家垅降雨量已达45毫米预计未来3小时麻城市中南部降雨量将达70毫米以上伴有雷电阵风6-8致灾风险高请加强防范 {{item.content}}
</view> </view>
</view> </view>
</view> </view>

View File

@ -8,23 +8,27 @@
<view class="" style="margin-top: 44px;border-top: 1px solid #f0f0f0;"> <view class="" style="margin-top: 44px;border-top: 1px solid #f0f0f0;">
<view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;"> <view class="" v-for="item in list" style="margin: 10px;background-color: #fff;padding: 10px;">
<view class="item"> <view class="item">
<!-- {{item.title}} --> <text>{{item.stationCode}}</text>
<image src="../../../static/c1.png" style="width: 79px;height: 68px;"></image> <text>{{item.tm}}</text>
</view> </view>
<view class="contentItem"> <view class="contentItem">
<view class="itemC"> <view class="itemC">
<text>巡检项:</text> <text>预警级别:</text>
<text>{{item.xjx}}</text> <text>{{item.level===1?'黄色':'红色'}}</text>
</view> </view>
<view class="itemC"> <view class="itemC">
<text>巡查人:</text> <text>监测值(mm):</text>
<text>{{item.name}}</text> <text>{{item.value}}</text>
</view> </view>
<view class="itemC"> <view class="itemC">
<text>巡查时间:</text> <text>阈值:</text>
<text>{{item.time}}</text> <text>{{item.time}}</text>
</view> </view>
<view class="itemC">
<text>校验规则描述:</text>
<text>{{item.ruleDesc}}</text>
</view>
</view> </view>
</view> </view>

View File

@ -77,7 +77,10 @@
}, },
todetail(key,e){ todetail(key,e){
let arr = encodeURIComponent(JSON.stringify(e)) let arr = encodeURIComponent(JSON.stringify(e))
console.log(key); console.log(key,e.length?.length);
if(!e.length?.length){
return;
}
if(key=='qxWarn'){ if(key=='qxWarn'){
uni.navigateTo({ uni.navigateTo({
url:'/pages/yj/detail/qxyj?list='+arr url:'/pages/yj/detail/qxyj?list='+arr
@ -88,6 +91,16 @@
url:'/pages/yj/detail/wyyj?list='+arr url:'/pages/yj/detail/wyyj?list='+arr
}) })
} }
if(key == 'flowWarn'){
uni.navigateTo({
url:'/pages/yj/detail/wyyj?list='+arr
})
}
if(key == 'pressWarn'){
uni.navigateTo({
url:'/pages/yj/detail/wyyj?list='+arr
})
}
if(key == 'aiWarnCount'){ if(key == 'aiWarnCount'){
uni.navigateTo({ uni.navigateTo({
url:'/pages/yj/detail/aiyj?list='+arr url:'/pages/yj/detail/aiyj?list='+arr