dev:AI预警

This commit is contained in:
Vce 2024-04-29 21:19:18 +08:00
parent 158a2d5131
commit 3580e7bdba
8 changed files with 794 additions and 92 deletions

View File

@ -1004,8 +1004,18 @@
"enablePullDownRefresh": false
}
},
// {
// "path": "pages/alarmPage/index",
// "style": {
// "navigationBarTitleText": "报警提示",
// "enablePullDownRefresh": true,
// "onReachBottomDistance": 100,
// "navigationBarBackgroundColor": "#3A7BFF",
// "navigationBarTextStyle": "white"
// }
// },
{
"path": "pages/alarmPage/index",
"path": "pages/alarmPage/indexTwo",
"style": {
"navigationBarTitleText": "报警提示",
"enablePullDownRefresh": true,
@ -1509,6 +1519,22 @@
"enablePullDownRefresh": false
}
},
{
"path" : "pages/alarmPage/shutting/shutting",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/alarmPage/disposition/disposition",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh" : false
}
}
],
// "subPackages":[{

View File

@ -0,0 +1,329 @@
<template>
<view>
<view class="barBox">
<headers :themeType="'white'" :showBack="true">
<view class="title">
<view class="backBtn">
<view>
<!-- <span class="back" @click="goBack()">返回</span> -->
<span class="tip">违章处置</span>
</view>
</view>
</view>
</headers>
</view>
<view class="content">
<view class="row-line">
<view class="row-label">
<text style="color: firebrick;">*</text>
<text>处置结果</text>
</view>
<view class="row-content">
<radio-group @change="isShowContent" v-model="isDis">
<radio value="dis" checked="true">已处置</radio>
<radio value="ign">误报忽略</radio>
</radio-group>
</view>
</view>
<view class="row-line" v-show="isDis === 'dis'">
<view class="row-label">
<text>描述</text>
</view>
<view class="row-content">
<textarea :value="desc" @blur="bindTextAreaBlur" />
</view>
</view>
<view class="row-line" v-show="isDis === 'dis'">
<view class="row-label">
<text style="color: firebrick;">*</text>
<text>选择违章人员</text>
</view>
<view class="row-content">
<!-- <select v-model="workerId" class="row-select">
<option style="margin-left: 13px;" v-for="(item,i) in workerList" :key="i" :value="item.id">
{{item.workerName}}
</option>
</select> -->
<view class="row-input">
<picker mode="selector" :range="workerList" range-key="workerName" @change="onChange" filterable>
<view class="picker" style="margin-left: 12px;">
<view class="" style="color: #e1e1e1;" v-if="!selectedItem.workerName">
请选择违章人员
</view>
<view class="" v-else>
{{selectedItem.workerName}}
</view>
</view>
</picker>
</view>
</view>
</view>
<view class="row-line" v-show="isDis === 'dis'">
<view class="row-label">
<text style="color: firebrick;">*</text>
<text></text>
</view>
<view class="row-content">
<view class="row-input">
<input style="margin-left: 13px;" v-model="deductScore" class="uni-input" type="number" placeholder="" />
</view>
<text style="display: flex;align-items: center;margin-left: 10px;"></text>
</view>
</view>
</view>
<view class="confirm-btn" @click="confirm">
<view class="inner-btn">确认</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [
{ name: '苹果' },
{ name: '香蕉' },
{ name: '橙子' },
{ name: '葡萄' },
// ...
],
selectedItem: {},
isDis: 'dis',
workerId: '',
desc: '',
deductScore: '',
workerList: [],
workerInfoList: [],
handleResult: '',
alarmItem: {},
}
},
onLoad(option) {
this.alarmItem = JSON.parse(decodeURIComponent(option.item));
console.log('alarmItem',this.alarmItem)
},
mounted() {
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
this.getWorkerList()
},
methods: {
onChange(e) {
const index = e.detail.value;
this.selectedItem = this.workerList[index];
this.workerId = this.selectedItem.id
console.log("change!!!!!!!!!")
},
confirm(){
console.log(">>>>>>>>>>>>>>>>>>>>>>>");
console.log(this.selectedItem);
console.log(this.alarmItem);
if(this.isDis === 'dis') {
if(this.workerId === '' || this.workerId === null || this.workerId === undefined){
uni.showToast({
title: '请选择违章人员',
icon: "none"
})
return
}
if(!this.deductScore){
uni.showToast({
title: '请输入分数',
icon: "none"
})
return
}
if(this.deductScore < 0 || this.deductScore > 100){
uni.showToast({
title: '请输入0-100内的分数',
icon: "none"
})
return
}
this.handleResult = 1
this.alarmItem.desc = this.desc
this.alarmItem.workerInfoList = [{id: this.workerId}]
this.alarmItem.deductScore = this.deductScore
this.alarmItem.handleResult = this.handleResult
}
if(this.isDis === 'ign'){
this.handleResult = 2
this.alarmItem.handleResult = this.handleResult
}
this.alarmItem.projectSn = this.projectSn
this.sendRequest({
url: 'xmgl/aiAnalyseHardWareAlarmRecord/edit',
method: "post",
data: this.alarmItem,
success: res => {
if (res.code == 200) {
console.log('res', res)
uni.navigateTo({
url: "/pages/alarmPage/indexTwo"
});
}
}
})
},
getWorkerList(){
this.sendRequest({
url: 'xmgl/workerInfo/selectWorkerInfoList',
method: "post",
data: {
projectSn: this.projectSn,
},
success: res => {
if (res.code == 200) {
console.log('workerListRes', res)
this.workerList = res.result.records
}
}
})
},
isShowContent(e){
this.isDis = e.detail.value
if(this.isDis === 'ign'){
this.cleanForm()
}
},
cleanForm(){
this.workerId = ''
this.desc = ''
this.deductScore = ''
},
bindTextAreaBlur(e) {
this.desc = e.detail.value
console.log(e.detail.value)
},
change(e) {
console.log("e:", e);
},
}
}
</script>
<style lang="scss" scoped>
.confirm-btn{
width: 100%;
height: 45px;
// background-color: darkred;
position: absolute;
bottom: 5%;
display: flex;
justify-content: center;
.inner-btn{
width: 65%;
height: 45px;
color: #fff;
background-color: #5181f6;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
}
}
.content{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.row-line{
margin-top: 10px;
display: flex;
align-items: center;
width: 100%;
.row-label{
display: flex;
justify-content: flex-end;
width: 30%;
}
.row-content{
width: 70%;
margin-left: 20px;
display: flex;
radio{
// font-size: 18px;
margin-right: 30px;
// transform:scale(0.7);
}
/deep/uni-textarea {
width: 70%;
height: 200rpx;
padding: 26rpx 28rpx;
box-sizing: border-box;
font-size: 28rpx;
// background-color: #efefef;
border: 1px solid #d8d8d8;
border-radius: 3px;
.uni-textarea-compute {
width: 100%;
height: 100%;
overflow: auto;
}
}
.row-select{
width: 70%;
height: 68rpx;
border: 1px solid #d8d8d8;
display: flex;
align-items: center;
border-radius: 3px;
background-color: #fff;
}
.row-input{
width: 70%;
height: 78rpx;
border: 1px solid #d8d8d8;
display: flex;
align-items: center;
border-radius: 3px;
}
.select-container{
// height: 80px;
// overflow: auto;
}
}
}
}
.barBox {
background-color: #5181F6;
}
.title {
height: 44px;
line-height: 44px;
font-size: 20px;
width: 750rpx;
background-color: #5181F6;
color: #fff;
text-align: center;
position: relative;
}
.backBtn {
// display: flex;
// justify-content: flex-start;
font-size: 16px;
position: absolute;
left: 20%;
}
.back {
font-size: 12px;
}
.tip {
margin-left: 5rem;
}
</style>

View File

@ -1,28 +1,60 @@
<template>
<view>
<view class="barBox">
<headers :themeType="'white'" clss>
<view class="title">
<view class="backBtn">
<view >
<span class="back" @click="goBack()">返回</span>
<span class="tip">告警提示</span>
</view>
<headers :themeType="'white'" :showBack="true">
<view class="title">
<view class="backBtn">
<view>
<!-- <span class="back" @click="goBack()">返回</span> -->
<span class="tip">告警提示</span>
</view>
</view>
</headers>
</view>
<view class="">
<view class="alarm-item" v-for="(item,index) in listData" :key="index" @click="goHiidden()">
<view>报警类型: {{item.alarmType}}</view>
<view>报警设备: {{item.hardwareName}}</view>
<view>报警时间: {{item.createTime}}</view>
<view>报警地址: {{item.location}}</view>
<view>报警抓拍:</view>
<image @click="saveImage(url_config+'image/'+item.imageUrl,index)" class="accessoryImg"
:src="url_config+'image/'+item.imageUrl"></image>
</view>
</view>
</view>
</headers>
</view>
<view class="">
<!-- <view class="alarm-item" v-for="(item,index) in listData" :key="index" @click="goHiidden()"> -->
<view class="alarm-item" v-for="(item,index) in listData" :key="index">
<view class="item-header">
<view class="header-left">
<view class="logo">
<image src="/static/aiWarn/aiWarn.png"></image>
</view>
<!-- <view class="header-info">未戴安全帽</view> -->
<!-- <view class="header-info">{{}}</view> -->
<view class="header-info">AI报警</view>
</view>
<view class="header-right" v-if="!item.handleResult">
<image src="/static/aiWarn/aiWarn2.png"></image>
</view>
<view class="header-right" v-else>
<image src="/static/aiWarn/correct.png"></image>
</view>
</view>
<view class="textCss">抓拍时间: {{item.createTime}}</view>
<view class="textCss">来源: {{item.alarmDesc}}</view>
<view class="item-bottom">
<view class="bottom-left">
<!-- <image mode="heightFix" @click="saveImage(url_config+'image/'+item.imageUrl,index)" class="accessoryImg"
src="/static/bg1.png"></image> -->
<!-- <image mode="heightFix" @click="saveImage(url_config+'image/'+item.imageUrl,index)" class="accessoryImg"
:src="item.imageUrl"></image> -->
<image v-if="item.imageUrl" mode="heightFix" class="accessoryImg"
:src="item.imageUrl"
@click="previewImg(item.imageUrl)"></image>
<!-- @click="previewImg(url_config+'image/'+item.imageUrl)"></image> -->
</view>
<view class="bottom-right" @click="goDisposition(item)" v-if="!item.handleResult">
去处置
</view>
<view class="bottom-right" @click="goShutting(item)" style="background-color: #b0b0b0;" v-else>
已闭合
</view>
</view>
</view>
</view>
</view>
</template>
@ -37,38 +69,15 @@
systemInfo: {
statusBarHeight: 0
},
showType: [{
id: 1,
value: '安全帽报警',
},
{
id: 2,
vlaue: '明火报警'
},
{
id: 3,
value: '聚众报警'
},
{
id: 4,
value: '未戴安全帽报警'
},
{
id: 5,
value: '越界报警'
},
{
id: 6,
value: '闯入报警'
},
{
id: 7,
value: '反光衣报警'
},
{
id: 8,
value: '未穿反光衣'
},
showType: [
{ id: 1, value: '安全帽报警', },
{ id: 2, vlaue: '明火报警' },
{ id: 3, value: '聚众报警' },
{ id: 4, value: '未戴安全帽报警' },
{ id: 5, value: '越界报警' },
{ id: 6, value: '闯入报警' },
{ id: 7, value: '反光衣报警' },
{ id: 8, value: '未穿反光衣' },
]
}
},
@ -105,12 +114,13 @@
success: res => {
if (res.code == 200) {
console.log('res', res)
res.result.records.forEach((item) => {
const result = this.showType.find((item2) => {
return item2.id == item.alarmType
})
item.alarmType = result.value
})
// res.result.records.forEach((item) => {
// const result = this.showType.find((item2) => {
// return item2.id == item.alarmType
// })
// // item.alarmType = result.value
// item.alarmType = result.alarmType
// })
if (this.pageNo == 1) {
this.listData = []
}
@ -128,42 +138,133 @@
});
},
//
goHiidden(url) {
goDisposition(item) {
console.log("=================================================");
uni.navigateTo({
url: "/pages/projectEnd/safeManage/addExamine"
url: "/pages/alarmPage/disposition/disposition?item="+ encodeURIComponent(JSON.stringify(item))
});
},
saveImage(url) {
uni.showLoading({
title: "保存中..."
})
uni.downloadFile({
url: url, //
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath, //
success: res => { //
uni.hideLoading()
uni.showToast({
title: "保存成功!"
})
uni.navigateTo({
url: "/pages/projectEnd/safeManage/addExamine"
});
}
})
}
}
//
goShutting(item) {
console.log("=================================================");
uni.navigateTo({
// url: "/pages/alarmPage/disposition/disposition?item="+ encodeURIComponent(JSON.stringify(item))
url: "/pages/alarmPage/shutting/shutting?item="+ encodeURIComponent(JSON.stringify(item))
});
},
previewImg(imgUrl){
console.log(imgUrl)
//urls
let imgurl=imgUrl
let imgArr=[]
imgArr[0] = imgurl
uni.previewImage({
current:0,
urls: imgArr
})
},
// saveImage(url) {
// uni.showLoading({
// title: "..."
// })
// uni.downloadFile({
// url: url, //
// success: (res) => {
// if (res.statusCode === 200) {
// uni.saveImageToPhotosAlbum({
// filePath: res.tempFilePath, //
// success: res => { //
// uni.hideLoading()
// uni.showToast({
// title: ""
// })
// uni.navigateTo({
// url: "/pages/projectEnd/safeManage/addExamine"
// });
// }
// })
// }
// }
// });
}
// }
}
}
</script>
<style lang="scss" scoped>
.item-bottom{
display: flex;
justify-content: space-between;
align-items: flex-end;
// height: 100px;
.bottom-left{
}
.bottom-right{
width: 25%;
font-size: 14px;
background-color: #5181f6;
color: #fff;
padding: 5px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
z-index: 999;
}
}
.accessoryImg {
margin-top: 20px;
// width: 100%;
max-width: 150px;
max-height: 75px;
}
.item-header{
display: flex;
justify-content: space-between;
width: 100%;
.header-left{
height: 30px;
width: 40%;
// background-color: darkred;
display: flex;
justify-content: flex-start;
align-items: center;
.logo{
width: 20%;
height: 100%;
background-size: 100% 100%;
::v-deep uni-image>div, uni-image>img{
width: 7%;
height: 10%;
}
}
.header-info{
font-size: 16px;
}
}
.header-right{
width: 10%;
height: 20px;
// background-color: #5181F6;
::v-deep uni-image>div, uni-image>img{
width: 11.5%;
height: 15%;
}
transform: translateY(-10px);
// position: absolute;
// right: 10%;
// top: 5;
}
}
.textCss{
letter-spacing: 1px;
color: #a9a9a9;
margin-top: 10px;
font-size: 12px;
}
.barBox {
background-color: #5181F6;
}
@ -179,12 +280,10 @@
position: relative;
}
.accessoryImg {
margin-top: 5px;
width: 100%;
}
.backBtn {
// display: flex;
// justify-content: flex-start;
font-size: 16px;
position: absolute;
left: 20%;
@ -193,7 +292,8 @@
.back {
font-size: 12px;
}
.tip{
.tip {
margin-left: 5rem;
}
@ -211,7 +311,7 @@
background-color: #fff;
padding: 20px;
box-sizing: border-box;
border-radius: 5px;
border-radius: 10px;
box-shadow: 0 0 5px #ccc;
}
@ -228,4 +328,4 @@
text-align: right;
color: #888;
}
</style>
</style>

View File

@ -0,0 +1,242 @@
<template>
<view>
<view class="barBox">
<headers :themeType="'white'" :showBack="true">
<view class="title">
<view class="backBtn">
<view>
<!-- <span class="back" @click="goBack()">返回</span> -->
<span class="tip">违章处置</span>
</view>
</view>
</view>
</headers>
</view>
<view class="content">
<view class="row-line">
<view class="row-label">
<text style="color: firebrick;">*</text>
<text>处置结果</text>
</view>
<view class="row-content">
<!-- <text style="color: #d8d8d8;">已处置</text> -->
<radio-group @change="isShowContent" v-model="isDis">
<radio value="dis" checked="true">已处置</radio>
<radio value="ign" disabled="true" style="">误报忽略</radio>
</radio-group>
</view>
</view>
<view class="row-line" v-show="isDis === 'dis'">
<view class="row-label">
<text>描述</text>
</view>
<view class="row-content">
<textarea style="background-color: #e1e1e1;" disabled :value="alarmItem.desc" @blur="bindTextAreaBlur" />
</view>
</view>
<view class="row-line" v-show="isDis === 'dis'">
<view class="row-label">
<text style="color: firebrick;">*</text>
<text>违章人员</text>
</view>
<view class="row-content">
<view style="background-color: #e1e1e1;" class="row-select">
<text style="margin-left: 13px;">{{alarmItem.workerInfoStr}}</text>
</view>
<!-- <select v-model="alarmItem.workerInfoStr" class="row-select">
<option :value="alarmItem.workerInfoStr" checked="true" disabled>{{alarmItem.workerInfoStr}}</option>
</select> -->
</view>
</view>
<view class="row-line" v-show="isDis === 'dis'">
<view class="row-label">
<text style="color: firebrick;">*</text>
<text></text>
</view>
<view class="row-content">
<view class="row-input" style="background-color: #e1e1e1;">
<!-- <input disabled="true" style="margin-left: 13px;" v-model="alarmItem.deductScore" class="uni-input" type="number" placeholder=""/> -->
<text style="margin-left: 13px;">{{alarmItem.deductScore}}</text>
</view>
<text style="display: flex;align-items: center;margin-left: 10px;"></text>
</view>
</view>
</view>
<!-- <view class="confirm-btn" @click="confirm">
<view class="inner-btn">确认</view>
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
isDis: 'dis',
dispositionForm: {
workerId: '',
desc: '',
deductScore: '',
},
workerList: [],
workerInfoList: [],
handleResult: '',
alarmItem: {}
}
},
onLoad(option) {
this.alarmItem = JSON.parse(decodeURIComponent(option.item));
console.log('alarmItem',this.alarmItem)
},
mounted() {
this.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
// this.getWorkerList()
},
methods: {
getWorkerList(){
this.sendRequest({
url: 'xmgl/workerInfo/selectWorkerInfoList',
method: "post",
data: {
projectSn: this.projectSn,
},
success: res => {
if (res.code == 200) {
console.log('workerListRes', res)
this.workerList = res.result.records
}
}
})
},
isShowContent(e){
this.isDis = e.detail.value
if(this.isDis === 'ign'){
this.cleanForm()
}
console.log(this.dispositionForm);
},
cleanForm(){
this.dispositionForm.workerId = ''
this.dispositionForm.desc = ''
this.dispositionForm.deductScore = ''
},
bindTextAreaBlur(e) {
this.dispositionForm.desc = e.detail.value
console.log(e.detail.value)
},
change(e) {
console.log("e:", e);
},
bindPickerChange: function(e) {
console.log('picker发送选择改变携带值为', e.detail.value)
this.index = e.detail.value
},
}
}
</script>
<style lang="scss" scoped>
.confirm-btn{
width: 100%;
height: 45px;
position: absolute;
bottom: 5%;
display: flex;
justify-content: center;
.inner-btn{
width: 65%;
height: 45px;
color: #fff;
background-color: #5181f6;
display: flex;
justify-content: center;
align-items: center;
border-radius: 5px;
}
}
.content{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.row-line{
margin-top: 10px;
display: flex;
align-items: center;
width: 100%;
.row-label{
display: flex;
justify-content: flex-end;
width: 30%;
}
.row-content{
width: 70%;
margin-left: 20px;
display: flex;
radio{
margin-right: 30px;
}
/deep/uni-textarea {
width: 70%;
height: 200rpx;
padding: 26rpx 28rpx;
box-sizing: border-box;
font-size: 28rpx;
border: 1px solid #e1e1e1;
border-radius: 3px;
.uni-textarea-compute {
width: 100%;
height: 100%;
overflow: auto;
}
}
.row-select{
width: 70%;
height: 68rpx;
border: 1px solid #e1e1e1;
display: flex;
align-items: center;
border-radius: 3px;
}
.row-input{
width: 60%;
height: 68rpx;
border: 1px solid #e1e1e1;
display: flex;
align-items: center;
border-radius: 3px;
}
}
}
}
.barBox {
background-color: #5181F6;
}
.title {
height: 44px;
line-height: 44px;
font-size: 20px;
width: 750rpx;
background-color: #5181F6;
color: #fff;
text-align: center;
position: relative;
}
.backBtn {
font-size: 16px;
position: absolute;
left: 20%;
}
.back {
font-size: 12px;
}
.tip {
margin-left: 5rem;
}
</style>

View File

@ -663,9 +663,14 @@
url: '../progressManagement/index'
})
break
// case 'dangerBroadcast':
// uni.navigateTo({
// url: '../../alarmPage/index'
// })
// break
case 'dangerBroadcast':
uni.navigateTo({
url: '../../alarmPage/index'
url: '../../alarmPage/indexTwo'
})
break
case 'standardSchedule':

BIN
static/aiWarn/aiWarn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

BIN
static/aiWarn/aiWarn2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
static/aiWarn/correct.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB