|
|
@@ -34,9 +34,7 @@
|
|
|
<div class="selbase_seltype">
|
|
|
<div>
|
|
|
<span style="font-size: 14px">预警计算:</span>
|
|
|
- <el-radio v-model="warningsetoption.warning_type" label="0"
|
|
|
- >逐台预警</el-radio
|
|
|
- >
|
|
|
+ <el-radio v-model="warningsetoption.warning_type" label="0">逐台预警</el-radio>
|
|
|
<el-radio
|
|
|
v-model="warningsetoption.warning_type"
|
|
|
:disabled="warningsetoption.device_ids.length <= 1"
|
|
|
@@ -52,17 +50,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="warningset_setuser">
|
|
|
+ <div class="warningset_setuser" v-if="false">
|
|
|
<div class="warningset_setuser_top">
|
|
|
<p class="selbase_title">短信接收人</p>
|
|
|
<p class="compile" @click="dialogVisible = true">预警通讯录编辑</p>
|
|
|
</div>
|
|
|
- <el-select
|
|
|
- v-model="warningsetoption.send_user"
|
|
|
- multiple
|
|
|
- filterable
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-select v-model="warningsetoption.send_user" multiple filterable placeholder="请选择">
|
|
|
<el-option
|
|
|
v-for="item in userlist"
|
|
|
:key="item.value"
|
|
|
@@ -181,23 +174,11 @@
|
|
|
></el-input
|
|
|
>
|
|
|
<p>
|
|
|
- <i
|
|
|
- class="el-icon-circle-plus-outline"
|
|
|
- @click="addelemeent"
|
|
|
- ></i>
|
|
|
+ <i class="el-icon-circle-plus-outline" @click="addelemeent"></i>
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div
|
|
|
- class="three_left_item"
|
|
|
- v-for="(item, index) in confcopy"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model="item.value"
|
|
|
- placeholder="请选择"
|
|
|
- size="mini"
|
|
|
- filterable
|
|
|
- >
|
|
|
+ <div class="three_left_item" v-for="(item, index) in confcopy" :key="index">
|
|
|
+ <el-select v-model="item.value" placeholder="请选择" size="mini" filterable>
|
|
|
<el-option
|
|
|
v-for="num in 332"
|
|
|
:key="num"
|
|
|
@@ -213,11 +194,7 @@
|
|
|
></el-input
|
|
|
>
|
|
|
<p>
|
|
|
- <i
|
|
|
- class="el-icon-delete"
|
|
|
- style="color: #ff4949"
|
|
|
- @click="delelemeent(index)"
|
|
|
- ></i>
|
|
|
+ <i class="el-icon-delete" style="color: #ff4949" @click="delelemeent(index)"></i>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -226,11 +203,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-button
|
|
|
- type="success"
|
|
|
- style="margin-top: 20px"
|
|
|
- size="mini"
|
|
|
- @click="sure_sumbitwarn"
|
|
|
+ <el-button type="success" style="margin-top: 20px" size="mini" @click="sure_sumbitwarn"
|
|
|
>保存预警设置</el-button
|
|
|
>
|
|
|
<el-dialog
|
|
|
@@ -241,32 +214,17 @@
|
|
|
>
|
|
|
<div class="userlistbox" v-loading="loading">
|
|
|
<div class="userlistbox_caozuo">
|
|
|
- <el-input
|
|
|
- v-model="username"
|
|
|
- placeholder="请输入姓名"
|
|
|
- size="mini"
|
|
|
- ></el-input>
|
|
|
- <el-input
|
|
|
- v-model="useriphone"
|
|
|
- placeholder="请输入手机号"
|
|
|
- size="mini"
|
|
|
- ></el-input>
|
|
|
- <el-button type="success" size="mini" @click="adduser"
|
|
|
- >添加</el-button
|
|
|
- >
|
|
|
+ <el-input v-model="username" placeholder="请输入姓名" size="mini"></el-input>
|
|
|
+ <el-input v-model="useriphone" placeholder="请输入手机号" size="mini"></el-input>
|
|
|
+ <el-button type="success" size="mini" @click="adduser">添加</el-button>
|
|
|
</div>
|
|
|
<div class="userlistbox_table">
|
|
|
<el-table :data="tabledata" stripe height="300" style="width: 100%">
|
|
|
- <el-table-column prop="liaisons" label="姓名" width="180">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="phone" label="手机号" width="180">
|
|
|
- </el-table-column>
|
|
|
+ <el-table-column prop="liaisons" label="姓名" width="180"> </el-table-column>
|
|
|
+ <el-table-column prop="phone" label="手机号" width="180"> </el-table-column>
|
|
|
<el-table-column prop="address" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-popconfirm
|
|
|
- title="确定删除该联系人吗?"
|
|
|
- @confirm="deluser(scope.row)"
|
|
|
- >
|
|
|
+ <el-popconfirm title="确定删除该联系人吗?" @confirm="deluser(scope.row)">
|
|
|
<p style="color: #ff4949" slot="reference">删除</p>
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
@@ -329,12 +287,11 @@ export default {
|
|
|
getwarnset() {
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=device.device_sms_alert.user_pest_warning_statsu',
|
|
|
+ url: '/api/api_gateway?method=device.device_sms_alert.user_pest_warning_statsu',
|
|
|
data: this.qs.stringify({
|
|
|
warning_id: this.warnid
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
|
// console.log(res.data.data);
|
|
|
var data = res.data.data
|
|
|
@@ -342,16 +299,13 @@ export default {
|
|
|
this.warningsetoption.title = data.warning_name
|
|
|
this.warningsetoption.conf.pestCategoryNum = data.conf.pestCategoryNum
|
|
|
this.warningsetoption.conf.appointPestNum = data.conf.appointPestNum
|
|
|
- this.warningsetoption.conf.appointPestName = Number(
|
|
|
- data.conf.appointPestName
|
|
|
- )
|
|
|
+ this.warningsetoption.conf.appointPestName = Number(data.conf.appointPestName)
|
|
|
this.warningsetoption.conf.pestTotalNum = data.conf.pestTotalNum
|
|
|
|
|
|
this.warningsetoption.conf.pestTotal = data.conf.pestTotal == 'on'
|
|
|
this.warningsetoption.conf.pestWarn = data.conf.pestWarn == 'on'
|
|
|
this.warningsetoption.conf.appointPest = data.conf.appointPest == 'on'
|
|
|
- this.warningsetoption.conf.pestCategory =
|
|
|
- data.conf.pestCategory == 'on'
|
|
|
+ this.warningsetoption.conf.pestCategory = data.conf.pestCategory == 'on'
|
|
|
var flag = 0
|
|
|
for (var key in data.conf) {
|
|
|
if (key.indexOf('ppointPestNum') != -1) {
|
|
|
@@ -371,9 +325,9 @@ export default {
|
|
|
for (var key in data.device_ids) {
|
|
|
this.warningsetoption.device_ids.push(Number(key))
|
|
|
}
|
|
|
- for (var key in data.send_user) {
|
|
|
- this.warningsetoption.send_user.push(Number(key))
|
|
|
- }
|
|
|
+ // for (var key in data.send_user) {
|
|
|
+ // this.warningsetoption.send_user.push(Number(key))
|
|
|
+ // }
|
|
|
this.warningsetoption.warning_type = data.warning_type.toString()
|
|
|
} else {
|
|
|
this.$message({
|
|
|
@@ -388,14 +342,13 @@ export default {
|
|
|
getbaselist() {
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=device.device_sms_alert.user_warning_device_list',
|
|
|
+ url: '/api/api_gateway?method=device.device_sms_alert.user_warning_device_list',
|
|
|
data: this.qs.stringify({
|
|
|
page: '1',
|
|
|
page_size: 999999999,
|
|
|
device_type_id: '3'
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
|
var data = res.data.data.data
|
|
|
this.device_idslist = []
|
|
|
@@ -529,20 +482,10 @@ export default {
|
|
|
type: 'warning',
|
|
|
duration: 1500
|
|
|
})
|
|
|
- } else if (this.warningsetoption.send_user.length == 0) {
|
|
|
- this.$message({
|
|
|
- message: '请选择短信接收人',
|
|
|
- type: 'warning',
|
|
|
- duration: 1500
|
|
|
- })
|
|
|
} else {
|
|
|
for (var i = 0; i < this.confcopy.length; i++) {
|
|
|
- this.warningsetoption.conf[
|
|
|
- 'appointPestNum' + (i + 1)
|
|
|
- ] = this.confcopy[i].num
|
|
|
- this.warningsetoption.conf[
|
|
|
- 'appointPestName' + (i + 1)
|
|
|
- ] = this.confcopy[i].value
|
|
|
+ this.warningsetoption.conf['appointPestNum' + (i + 1)] = this.confcopy[i].num
|
|
|
+ this.warningsetoption.conf['appointPestName' + (i + 1)] = this.confcopy[i].value
|
|
|
}
|
|
|
|
|
|
var obj = JSON.parse(JSON.stringify(this.warningsetoption.conf))
|
|
|
@@ -568,17 +511,16 @@ export default {
|
|
|
// return;
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=device.device_sms_alert.create_user_pest_warning',
|
|
|
+ url: '/api/api_gateway?method=device.device_sms_alert.create_user_pest_warning',
|
|
|
data: this.qs.stringify({
|
|
|
title: this.warningsetoption.title,
|
|
|
device_ids: this.warningsetoption.device_ids.join(','),
|
|
|
warning_type: this.warningsetoption.warning_type,
|
|
|
conf: JSON.stringify(obj),
|
|
|
- send_user: this.warningsetoption.send_user.join(','),
|
|
|
+ // send_user: this.warningsetoption.send_user.join(','),
|
|
|
warning_id: this.warnid
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
this.loading = false
|
|
|
if (res.data.message == '') {
|
|
|
// //console.log(res.data)\
|
|
|
@@ -600,17 +542,16 @@ export default {
|
|
|
sumbitwarn_found(obj) {
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=device.device_sms_alert.create_user_warning_config',
|
|
|
+ url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_config',
|
|
|
data: this.qs.stringify({
|
|
|
title: this.warningsetoption.title,
|
|
|
device_type_id: 3,
|
|
|
device_ids: this.warningsetoption.device_ids.join(','),
|
|
|
warning_type: this.warningsetoption.warning_type,
|
|
|
- conf: JSON.stringify(obj),
|
|
|
- send_user: this.warningsetoption.send_user.join(',')
|
|
|
+ conf: JSON.stringify(obj)
|
|
|
+ // send_user: this.warningsetoption.send_user.join(',')
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
|
message: '添加成功',
|
|
|
@@ -632,13 +573,12 @@ export default {
|
|
|
this.loading = true
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- 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: this.qs.stringify({
|
|
|
page: '1',
|
|
|
page_size: 999999999
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
this.loading = false
|
|
|
if (res.data.message == '') {
|
|
|
var data = res.data.data.data
|
|
|
@@ -683,13 +623,12 @@ export default {
|
|
|
} else {
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=device.device_sms_alert.create_user_warning_liaisons',
|
|
|
+ url: '/api/api_gateway?method=device.device_sms_alert.create_user_warning_liaisons',
|
|
|
data: this.qs.stringify({
|
|
|
user_name: this.username,
|
|
|
phone: this.useriphone
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
|
message: '添加成功',
|
|
|
@@ -711,12 +650,11 @@ export default {
|
|
|
deluser(data) {
|
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
|
- url:
|
|
|
- '/api/api_gateway?method=device.device_sms_alert.del_user_warning_liaisons',
|
|
|
+ url: '/api/api_gateway?method=device.device_sms_alert.del_user_warning_liaisons',
|
|
|
data: this.qs.stringify({
|
|
|
d_id: data.d_id
|
|
|
})
|
|
|
- }).then(res => {
|
|
|
+ }).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
|
message: '删除成功',
|