|
@@ -1,9 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view class="content">
|
|
<view class="content">
|
|
|
<view class="cbwtop">
|
|
<view class="cbwtop">
|
|
|
- <image :src="
|
|
|
|
|
- 'http://www.hnyfwlw.com:8006/bigdata_app/image/cbyj/banner2.png'
|
|
|
|
|
- " mode="" class="image">
|
|
|
|
|
|
|
+ <image :src="bannersrc" mode="" class="image">
|
|
|
</image>
|
|
</image>
|
|
|
<view class="tab-box">
|
|
<view class="tab-box">
|
|
|
<view v-for="(item, index) in equipArr" :key="index" @click="tabClick(index)"
|
|
<view v-for="(item, index) in equipArr" :key="index" @click="tabClick(index)"
|
|
@@ -12,7 +10,7 @@
|
|
|
<text class="bottom-line"></text>
|
|
<text class="bottom-line"></text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="timeandtype" v-if="active==0">
|
|
|
|
|
|
|
+ <view class="timeandtype" v-if="active==0 && wranlistdata.length > 0">
|
|
|
<view class="timebox">
|
|
<view class="timebox">
|
|
|
<view class="firsttime" @click="timeshow=true">
|
|
<view class="firsttime" @click="timeshow=true">
|
|
|
{{start_time==""?'请选择开始时间':start_time}}
|
|
{{start_time==""?'请选择开始时间':start_time}}
|
|
@@ -30,11 +28,11 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="" v-show="active==0">
|
|
<view class="" v-show="active==0">
|
|
|
- <view class="warmlistbox">
|
|
|
|
|
|
|
+ <view class="warmlistbox" v-if="wranlistdata.length > 0">
|
|
|
<view class="warmlistbox_item" v-for="item in wranlistdata" :key="item.id" @click="singleread(item)">
|
|
<view class="warmlistbox_item" v-for="item in wranlistdata" :key="item.id" @click="singleread(item)">
|
|
|
<view class="warmlistbox_item_title" :style="{'border-color':item.status==1?'#14A478':'#fd4646'}">
|
|
<view class="warmlistbox_item_title" :style="{'border-color':item.status==1?'#14A478':'#fd4646'}">
|
|
|
<!-- {{recordtypelist[item.warning_type].label}} -->
|
|
<!-- {{recordtypelist[item.warning_type].label}} -->
|
|
|
- 气象预警
|
|
|
|
|
|
|
+ {{device_type == 5 ? '气象' : '墒情'}}预警
|
|
|
</view>
|
|
</view>
|
|
|
<view class="warmlistbox_item_text">
|
|
<view class="warmlistbox_item_text">
|
|
|
<view class="item_text_item">
|
|
<view class="item_text_item">
|
|
@@ -75,6 +73,9 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="warmlistbox empty" v-else>
|
|
|
|
|
+ 暂无数据
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="warmissuebox" v-show="active == 1">
|
|
<view class="warmissuebox" v-show="active == 1">
|
|
|
<view class="warmissue">
|
|
<view class="warmissue">
|
|
@@ -129,6 +130,9 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="wornsetbox" v-show="active == 2">
|
|
<view class="wornsetbox" v-show="active == 2">
|
|
|
|
|
+ <view class="empty" v-if="configlist.length == 0">
|
|
|
|
|
+ 暂无数据
|
|
|
|
|
+ </view>
|
|
|
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in configlist" :key="item.id"
|
|
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in configlist" :key="item.id"
|
|
|
@click="delconfig(item.id)" :options="options" style="margin-bottom: 30rpx;">
|
|
@click="delconfig(item.id)" :options="options" style="margin-bottom: 30rpx;">
|
|
|
<view class="wornsetbox_item" @click="toset(item.id)">
|
|
<view class="wornsetbox_item" @click="toset(item.id)">
|
|
@@ -142,7 +146,7 @@
|
|
|
</view>
|
|
</view>
|
|
|
</u-swipe-action>
|
|
</u-swipe-action>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="addwarnlist" v-show="active == 2" @click="addshow = true">
|
|
|
|
|
|
|
+ <view class="addwarnlist" v-show="active == 2" @click="addwarning_config">
|
|
|
添 加
|
|
添 加
|
|
|
</view>
|
|
</view>
|
|
|
<view class="">
|
|
<view class="">
|
|
@@ -185,6 +189,8 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ bannersrc:'http://www.hnyfwlw.com:8006/bigdata_app/image/cbyj/banner2.png',
|
|
|
|
|
+ device_type:'',
|
|
|
date: "",
|
|
date: "",
|
|
|
active: 0,
|
|
active: 0,
|
|
|
equipArr: ["预警记录", "预警发布", "预警设置"],
|
|
equipArr: ["预警记录", "预警发布", "预警设置"],
|
|
@@ -288,6 +294,7 @@
|
|
|
page: this.listpage,
|
|
page: this.listpage,
|
|
|
page_size: "10",
|
|
page_size: "10",
|
|
|
start_time: start_time,
|
|
start_time: start_time,
|
|
|
|
|
+ device_type: this.device_type
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
console.log(res)
|
|
console.log(res)
|
|
@@ -307,6 +314,7 @@
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_warning_liaisons_list',
|
|
|
data: {
|
|
data: {
|
|
|
page: 1,
|
|
page: 1,
|
|
|
|
|
+ device_type: this.device_type,
|
|
|
page_size: 9999999,
|
|
page_size: 9999999,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -323,7 +331,9 @@
|
|
|
async getmessagescounts() {
|
|
async getmessagescounts() {
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.remaining_messages_counts',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.remaining_messages_counts',
|
|
|
- data: {}
|
|
|
|
|
|
|
+ data: {
|
|
|
|
|
+ device_type: this.device_type
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
this.total_sms_counts = res.total_sms_counts
|
|
this.total_sms_counts = res.total_sms_counts
|
|
@@ -349,7 +359,8 @@
|
|
|
data: {
|
|
data: {
|
|
|
send_user: list.join(","),
|
|
send_user: list.join(","),
|
|
|
content: this.wormvalue,
|
|
content: this.wormvalue,
|
|
|
- device_type_id: 5
|
|
|
|
|
|
|
+ device_type_id: this.device_type,
|
|
|
|
|
+ device_type: this.device_type
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
console.log(res)
|
|
console.log(res)
|
|
@@ -376,6 +387,7 @@
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
|
|
|
data: {
|
|
data: {
|
|
|
req: "all",
|
|
req: "all",
|
|
|
|
|
+ device_type: this.device_type
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
if (res) {
|
|
if (res) {
|
|
@@ -396,7 +408,7 @@
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_record_read',
|
|
|
data: {
|
|
data: {
|
|
|
- id: this.warmstatus.id,
|
|
|
|
|
|
|
+ id: this.warmstatus.id
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
if (res) {
|
|
if (res) {
|
|
@@ -420,8 +432,9 @@
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_warning_config_list',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_warning_config_list',
|
|
|
data: {
|
|
data: {
|
|
|
- device_type_id: "5",
|
|
|
|
|
|
|
+ device_type_id: this.device_type,
|
|
|
page: this.confpage,
|
|
page: this.confpage,
|
|
|
|
|
+ device_type: this.device_type,
|
|
|
page_size: "10",
|
|
page_size: "10",
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -456,32 +469,36 @@
|
|
|
toset(id) {
|
|
toset(id) {
|
|
|
console.log(id)
|
|
console.log(id)
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: "./warnset?id=" + id
|
|
|
|
|
|
|
+ url: "./warnset?id=" + id + '&typeId=' + this.device_type
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
async addwarning_config() {
|
|
async addwarning_config() {
|
|
|
- this.addshow = true
|
|
|
|
|
- if (this.addvalue == "") {
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "请填写预警名称",
|
|
|
|
|
- icon: "none"
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- const res = await this.$myRequest({
|
|
|
|
|
- url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_config',
|
|
|
|
|
- data: {
|
|
|
|
|
- title: this.addvalue,
|
|
|
|
|
- device_type_id: 5
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- console.log(res)
|
|
|
|
|
- if (res) {
|
|
|
|
|
- this.addshow = false
|
|
|
|
|
- this.configlist = []
|
|
|
|
|
- this.confpage = 1
|
|
|
|
|
- this.getconfiglist()
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: "./warnset?type=new" + '&typeId=' + this.device_type
|
|
|
|
|
+ })
|
|
|
|
|
+ // this.addshow = true
|
|
|
|
|
+ // if (this.addvalue == "") {
|
|
|
|
|
+ // uni.showToast({
|
|
|
|
|
+ // title: "请填写预警名称",
|
|
|
|
|
+ // icon: "none"
|
|
|
|
|
+ // })
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // const res = await this.$myRequest({
|
|
|
|
|
+ // url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_config',
|
|
|
|
|
+ // data: {
|
|
|
|
|
+ // title: this.addvalue,
|
|
|
|
|
+ // device_type: this.device_type,
|
|
|
|
|
+ // device_type_id: this.device_type
|
|
|
|
|
+ // }
|
|
|
|
|
+ // })
|
|
|
|
|
+ // console.log(res)
|
|
|
|
|
+ // if (res) {
|
|
|
|
|
+ // this.addshow = false
|
|
|
|
|
+ // this.configlist = []
|
|
|
|
|
+ // this.confpage = 1
|
|
|
|
|
+ // this.getconfiglist()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
},
|
|
},
|
|
|
async delconfig(id){
|
|
async delconfig(id){
|
|
|
const res = await this.$myRequest({
|
|
const res = await this.$myRequest({
|
|
@@ -499,13 +516,20 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- onLoad() {
|
|
|
|
|
|
|
+ onLoad(option) {
|
|
|
|
|
+ console.log(option)
|
|
|
|
|
+ this.device_type = option.typeId;
|
|
|
|
|
+ if(option.typeId == 15) {
|
|
|
|
|
+ uni.setNavigationBarTitle({title:'墒情预警'})
|
|
|
|
|
+ this.bannersrc = 'https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/image/cbyj/banner15.png'
|
|
|
|
|
+ }
|
|
|
this.getwranlistdata()
|
|
this.getwranlistdata()
|
|
|
// this.getmessagescounts()
|
|
// this.getmessagescounts()
|
|
|
// this.getconfiglist()
|
|
// this.getconfiglist()
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
- this.getuseriphonelist()
|
|
|
|
|
|
|
+ this.getuseriphonelist();
|
|
|
|
|
+ this.getconfiglist();
|
|
|
},
|
|
},
|
|
|
onReachBottom() {
|
|
onReachBottom() {
|
|
|
if (this.active == 0) {
|
|
if (this.active == 0) {
|
|
@@ -662,7 +686,11 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ .empty{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
.warmissuebox {
|
|
.warmissuebox {
|
|
|
width: 95%;
|
|
width: 95%;
|
|
|
margin: 0 auto;
|
|
margin: 0 auto;
|