|
@@ -12,9 +12,7 @@
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <el-button type="success" size="mini" @click="sure_submitdata"
|
|
|
|
|
- >保存预警设置</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button type="success" size="mini" @click="sure_submitdata">保存预警设置</el-button>
|
|
|
<el-button type="success" size="mini" @click="goback">返回</el-button>
|
|
<el-button type="success" size="mini" @click="goback">返回</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -36,17 +34,12 @@
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="warningset_selbase_item">
|
|
|
|
|
|
|
+ <div class="warningset_selbase_item" v-if="false">
|
|
|
<div class="warningset_setuser_top">
|
|
<div class="warningset_setuser_top">
|
|
|
<p class="selbase_title">短信接收人</p>
|
|
<p class="selbase_title">短信接收人</p>
|
|
|
<p class="compile" @click="dialogVisible = true">预警通讯录编辑</p>
|
|
<p class="compile" @click="dialogVisible = true">预警通讯录编辑</p>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-select
|
|
|
|
|
- v-model="qxzoption.send_user_id"
|
|
|
|
|
- multiple
|
|
|
|
|
- filterable
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-select v-model="qxzoption.send_user_id" multiple filterable placeholder="请选择">
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in userlist"
|
|
v-for="item in userlist"
|
|
|
:key="item.value"
|
|
:key="item.value"
|
|
@@ -71,11 +64,7 @@
|
|
|
<el-table-column prop="name" label="通道名称"> </el-table-column>
|
|
<el-table-column prop="name" label="通道名称"> </el-table-column>
|
|
|
<el-table-column prop="type" label="运算符">
|
|
<el-table-column prop="type" label="运算符">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-select
|
|
|
|
|
- v-model="scope.row.type"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- size="mini"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-select v-model="scope.row.type" placeholder="请选择" size="mini">
|
|
|
<el-option label="小于" value="0">小于</el-option>
|
|
<el-option label="小于" value="0">小于</el-option>
|
|
|
<el-option label="大于" value="1">大于</el-option>
|
|
<el-option label="大于" value="1">大于</el-option>
|
|
|
<el-option label="介于" value="2">介于</el-option>
|
|
<el-option label="介于" value="2">介于</el-option>
|
|
@@ -90,9 +79,7 @@
|
|
|
placeholder="请输入内容"
|
|
placeholder="请输入内容"
|
|
|
oninput="value=value.replace(/[^\d]+/g,'')"
|
|
oninput="value=value.replace(/[^\d]+/g,'')"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- @blur="
|
|
|
|
|
- yanzheng(scope.row.value, scope.row.value2, scope.$index)
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ @blur="yanzheng(scope.row.value, scope.row.value2, scope.$index)"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
<span v-if="scope.row.type == '2'">-</span>
|
|
<span v-if="scope.row.type == '2'">-</span>
|
|
|
<el-input
|
|
<el-input
|
|
@@ -101,9 +88,7 @@
|
|
|
placeholder="请输入内容"
|
|
placeholder="请输入内容"
|
|
|
oninput="value=value.replace(/[^\d]+/g,'')"
|
|
oninput="value=value.replace(/[^\d]+/g,'')"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
- @blur="
|
|
|
|
|
- yanzheng(scope.row.value, scope.row.value2, scope.$index)
|
|
|
|
|
- "
|
|
|
|
|
|
|
+ @blur="yanzheng(scope.row.value, scope.row.value2, scope.$index)"
|
|
|
></el-input>
|
|
></el-input>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -118,32 +103,17 @@
|
|
|
>
|
|
>
|
|
|
<div class="userlistbox" v-loading="loading">
|
|
<div class="userlistbox" v-loading="loading">
|
|
|
<div class="userlistbox_caozuo">
|
|
<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>
|
|
|
<div class="userlistbox_table">
|
|
<div class="userlistbox_table">
|
|
|
<el-table :data="tabledata" stripe height="300" style="width: 100%">
|
|
<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="操作">
|
|
<el-table-column prop="address" label="操作">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-popconfirm
|
|
|
|
|
- title="确定删除该联系人吗?"
|
|
|
|
|
- @confirm="deluser(scope.row)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-popconfirm title="确定删除该联系人吗?" @confirm="deluser(scope.row)">
|
|
|
<el-button type="danger" size="mini" slot="reference">删除</el-button>
|
|
<el-button type="danger" size="mini" slot="reference">删除</el-button>
|
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
|
</template>
|
|
</template>
|
|
@@ -156,13 +126,13 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
|
|
|
-import { Debounce } from '../../../util/anitthro';
|
|
|
|
|
|
|
+// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
|
|
|
+import { Debounce } from '../../../util/anitthro'
|
|
|
export default {
|
|
export default {
|
|
|
- //import引入的组件需要注入到对象中才能使用
|
|
|
|
|
|
|
+ // import引入的组件需要注入到对象中才能使用
|
|
|
components: {},
|
|
components: {},
|
|
|
data() {
|
|
data() {
|
|
|
- //这里存放数据
|
|
|
|
|
|
|
+ // 这里存放数据
|
|
|
return {
|
|
return {
|
|
|
warnid: '',
|
|
warnid: '',
|
|
|
qxzoption: {
|
|
qxzoption: {
|
|
@@ -170,7 +140,7 @@ export default {
|
|
|
device_id: '', // 必传(str) 设备号
|
|
device_id: '', // 必传(str) 设备号
|
|
|
warning_id: [], // 必传(str) 预警设置id
|
|
warning_id: [], // 必传(str) 预警设置id
|
|
|
conf: [], // 必传(str) 预警设置
|
|
conf: [], // 必传(str) 预警设置
|
|
|
- send_user_id: [], //
|
|
|
|
|
|
|
+ send_user_id: [] //
|
|
|
},
|
|
},
|
|
|
device_idslist: [],
|
|
device_idslist: [],
|
|
|
userlist: [],
|
|
userlist: [],
|
|
@@ -183,15 +153,15 @@ export default {
|
|
|
fanxianid: '',
|
|
fanxianid: '',
|
|
|
fanxianconf: {},
|
|
fanxianconf: {},
|
|
|
device_type: ''
|
|
device_type: ''
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
- //监听属性 类似于data概念
|
|
|
|
|
|
|
+ // 监听属性 类似于data概念
|
|
|
computed: {},
|
|
computed: {},
|
|
|
- //监控data中的数据变化
|
|
|
|
|
|
|
+ // 监控data中的数据变化
|
|
|
watch: {},
|
|
watch: {},
|
|
|
- //方法集合
|
|
|
|
|
|
|
+ // 方法集合
|
|
|
methods: {
|
|
methods: {
|
|
|
- //获取设备列表
|
|
|
|
|
|
|
+ // 获取设备列表
|
|
|
getbaselist() {
|
|
getbaselist() {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
@@ -201,176 +171,176 @@ export default {
|
|
|
page_size: 999999999,
|
|
page_size: 999999999,
|
|
|
device_type_id: this.device_type,
|
|
device_type_id: this.device_type,
|
|
|
device_type: this.device_type
|
|
device_type: this.device_type
|
|
|
- }),
|
|
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
- var data = res.data.data.data;
|
|
|
|
|
|
|
+ var data = res.data.data.data
|
|
|
// this.device_idslist = [];
|
|
// this.device_idslist = [];
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
var obj = {
|
|
var obj = {
|
|
|
value: data[i].device_id,
|
|
value: data[i].device_id,
|
|
|
- label: data[i].device_id,
|
|
|
|
|
- };
|
|
|
|
|
- this.device_idslist.push(obj);
|
|
|
|
|
|
|
+ label: data[i].device_id
|
|
|
|
|
+ }
|
|
|
|
|
+ this.device_idslist.push(obj)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- //获取通讯录
|
|
|
|
|
|
|
+ // 获取通讯录
|
|
|
getuserlistdata() {
|
|
getuserlistdata() {
|
|
|
- this.loading = true;
|
|
|
|
|
|
|
+ this.loading = true
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
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({
|
|
data: this.qs.stringify({
|
|
|
page: '1',
|
|
page: '1',
|
|
|
- page_size: 999999999,
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ page_size: 999999999
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- this.loading = false;
|
|
|
|
|
|
|
+ this.loading = false
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
- var data = res.data.data.data;
|
|
|
|
|
|
|
+ var data = res.data.data.data
|
|
|
// //console.log(data)
|
|
// //console.log(data)
|
|
|
- this.tabledata = res.data.data.data;
|
|
|
|
|
- this.userlist = [];
|
|
|
|
|
|
|
+ this.tabledata = res.data.data.data
|
|
|
|
|
+ this.userlist = []
|
|
|
for (var i = 0; i < data.length; i++) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
|
var obj = {
|
|
var obj = {
|
|
|
value: data[i].d_id,
|
|
value: data[i].d_id,
|
|
|
- label: data[i].liaisons + '/' + data[i].phone,
|
|
|
|
|
- };
|
|
|
|
|
- this.userlist.push(obj);
|
|
|
|
|
|
|
+ label: data[i].liaisons + '/' + data[i].phone
|
|
|
|
|
+ }
|
|
|
|
|
+ this.userlist.push(obj)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- //添加用户
|
|
|
|
|
|
|
+ // 添加用户
|
|
|
adduser() {
|
|
adduser() {
|
|
|
if (this.username == '') {
|
|
if (this.username == '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '请填写名称',
|
|
message: '请填写名称',
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
} else if (this.useriphone == '') {
|
|
} else if (this.useriphone == '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '请填写手机号',
|
|
message: '请填写手机号',
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
} else if (!/^1(1|2|3|4|5|6|7|8|9)\d{9}$/.test(this.useriphone)) {
|
|
} else if (!/^1(1|2|3|4|5|6|7|8|9)\d{9}$/.test(this.useriphone)) {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '请填写正确手机号',
|
|
message: '请填写正确手机号',
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
} else {
|
|
} else {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
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({
|
|
data: this.qs.stringify({
|
|
|
user_name: this.username,
|
|
user_name: this.username,
|
|
|
- phone: this.useriphone,
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ phone: this.useriphone
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '添加成功',
|
|
message: '添加成功',
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
- this.getuserlistdata();
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getuserlistdata()
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- //删除用户
|
|
|
|
|
|
|
+ // 删除用户
|
|
|
deluser(data) {
|
|
deluser(data) {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
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({
|
|
data: this.qs.stringify({
|
|
|
- d_id: data.d_id,
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ d_id: data.d_id
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '删除成功',
|
|
message: '删除成功',
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
- this.getuserlistdata();
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getuserlistdata()
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
- //获取气象站预警配置
|
|
|
|
|
|
|
+ // 获取气象站预警配置
|
|
|
getqxzwarninfo() {
|
|
getqxzwarninfo() {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_statsu',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.user_qxz_warning_statsu',
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
- warning_id: this.warnid,
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ warning_id: this.warnid
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
- //console.log(res.data);
|
|
|
|
|
|
|
+ // console.log(res.data);
|
|
|
// var obj = {
|
|
// var obj = {
|
|
|
// value: res.data.data.device_ids,
|
|
// value: res.data.data.device_ids,
|
|
|
// label: res.data.data.device_ids,
|
|
// label: res.data.data.device_ids,
|
|
|
// };
|
|
// };
|
|
|
// this.device_idslist.unshift(obj);
|
|
// this.device_idslist.unshift(obj);
|
|
|
- this.qxzoption.title = res.data.data.warning_name;
|
|
|
|
|
- this.qxzoption.device_id = res.data.data.device_ids;
|
|
|
|
|
- this.fanxianid = res.data.data.device_ids;
|
|
|
|
|
- this.fanxianconf = {};
|
|
|
|
|
- res.data.data.conf.forEach(item => {
|
|
|
|
|
|
|
+ this.qxzoption.title = res.data.data.warning_name
|
|
|
|
|
+ this.qxzoption.device_id = res.data.data.device_ids
|
|
|
|
|
+ this.fanxianid = res.data.data.device_ids
|
|
|
|
|
+ this.fanxianconf = {}
|
|
|
|
|
+ res.data.data.conf.forEach((item) => {
|
|
|
for (let key in item) {
|
|
for (let key in item) {
|
|
|
- this.fanxianconf[key]=item[key]
|
|
|
|
|
|
|
+ this.fanxianconf[key] = item[key]
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- for (var key in res.data.data.send_user) {
|
|
|
|
|
- this.qxzoption.send_user_id.push(Number(key));
|
|
|
|
|
- }
|
|
|
|
|
- this.getqxzwarninfo2(res.data.data.device_ids);
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ // for (var key in res.data.data.send_user) {
|
|
|
|
|
+ // this.qxzoption.send_user_id.push(Number(key));
|
|
|
|
|
+ // }
|
|
|
|
|
+ this.getqxzwarninfo2(res.data.data.device_ids)
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
selbasechange: Debounce(function (e) {
|
|
selbasechange: Debounce(function (e) {
|
|
|
// //console.log(e);
|
|
// //console.log(e);
|
|
|
// //console.log(this.device_idslist[index]);
|
|
// //console.log(this.device_idslist[index]);
|
|
|
let obj = this.device_idslist.find((item) => {
|
|
let obj = this.device_idslist.find((item) => {
|
|
|
- return item.value == e;
|
|
|
|
|
- });
|
|
|
|
|
- this.getqxzwarninfo2(obj.label);
|
|
|
|
|
|
|
+ return item.value == e
|
|
|
|
|
+ })
|
|
|
|
|
+ this.getqxzwarninfo2(obj.label)
|
|
|
}, 1500),
|
|
}, 1500),
|
|
|
getqxzwarninfo2(device_id) {
|
|
getqxzwarninfo2(device_id) {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
@@ -379,97 +349,94 @@ export default {
|
|
|
data: this.qs.stringify({
|
|
data: this.qs.stringify({
|
|
|
device_id: device_id,
|
|
device_id: device_id,
|
|
|
device_type: this.device_type,
|
|
device_type: this.device_type,
|
|
|
- status: 'see',
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ status: 'see'
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- this.daotabledata = [];
|
|
|
|
|
|
|
+ this.daotabledata = []
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
// //console.log(res.data.data.conf);
|
|
// //console.log(res.data.data.conf);
|
|
|
- var data = res.data.data.conf;
|
|
|
|
|
- var selarr = [];
|
|
|
|
|
|
|
+ var data = res.data.data.conf
|
|
|
|
|
+ var selarr = []
|
|
|
for (var key in data) {
|
|
for (var key in data) {
|
|
|
var obj = {
|
|
var obj = {
|
|
|
tongdao: key,
|
|
tongdao: key,
|
|
|
name: data[key],
|
|
name: data[key],
|
|
|
value: '',
|
|
value: '',
|
|
|
value2: '',
|
|
value2: '',
|
|
|
- type: '',
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ type: ''
|
|
|
|
|
+ }
|
|
|
if (device_id == this.fanxianid) {
|
|
if (device_id == this.fanxianid) {
|
|
|
for (let confkey in this.fanxianconf) {
|
|
for (let confkey in this.fanxianconf) {
|
|
|
// //console.log(confkey, key);
|
|
// //console.log(confkey, key);
|
|
|
if (confkey == key) {
|
|
if (confkey == key) {
|
|
|
- var arr = this.fanxianconf[key].split('|')[0].split('#');
|
|
|
|
|
- if (arr[1].indexOf('&')) {
|
|
|
|
|
- arr[1] = arr[1].split('&');
|
|
|
|
|
- obj.value2 = arr[1][1];
|
|
|
|
|
- obj.value = arr[1][0];
|
|
|
|
|
|
|
+ var arr = this.fanxianconf[key].split('|')[0].split('#')
|
|
|
|
|
+ if (arr[1].indexOf('&')) {
|
|
|
|
|
+ arr[1] = arr[1].split('&')
|
|
|
|
|
+ obj.value2 = arr[1][1]
|
|
|
|
|
+ obj.value = arr[1][0]
|
|
|
}
|
|
}
|
|
|
- obj.type = arr[0] + '';
|
|
|
|
|
- selarr.push(obj);
|
|
|
|
|
|
|
+ obj.type = arr[0] + ''
|
|
|
|
|
+ selarr.push(obj)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- this.daotabledata.push(obj);
|
|
|
|
|
|
|
+ this.daotabledata.push(obj)
|
|
|
}
|
|
}
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
for (var i = 0; i < selarr.length; i++) {
|
|
for (var i = 0; i < selarr.length; i++) {
|
|
|
- this.$refs.multipleTable.toggleRowSelection(selarr[i]);
|
|
|
|
|
|
|
+ this.$refs.multipleTable.toggleRowSelection(selarr[i])
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
|
|
|
|
|
- //console.log(this.daotabledata);
|
|
|
|
|
|
|
+ // console.log(this.daotabledata);
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
|
- //console.log(val);
|
|
|
|
|
- this.seldatblevalue = val;
|
|
|
|
|
|
|
+ // console.log(val);
|
|
|
|
|
+ this.seldatblevalue = val
|
|
|
},
|
|
},
|
|
|
yanzheng(a, b, index) {
|
|
yanzheng(a, b, index) {
|
|
|
if (b <= a) {
|
|
if (b <= a) {
|
|
|
- this.daotabledata[index].value2 = '';
|
|
|
|
|
|
|
+ this.daotabledata[index].value2 = ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
vit() {
|
|
vit() {
|
|
|
if (!this.qxzoption.device_id) {
|
|
if (!this.qxzoption.device_id) {
|
|
|
- return '请选择预警设备';
|
|
|
|
|
- }
|
|
|
|
|
- if (!this.qxzoption.send_user_id.length) {
|
|
|
|
|
- return '请选择短信接收人';
|
|
|
|
|
|
|
+ return '请选择预警设备'
|
|
|
}
|
|
}
|
|
|
|
|
+ // if (!this.qxzoption.send_user_id.length) {
|
|
|
|
|
+ // return '请选择短信接收人';
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
for (var i = 0; i < this.seldatblevalue.length; i++) {
|
|
for (var i = 0; i < this.seldatblevalue.length; i++) {
|
|
|
// this.daotabledata
|
|
// this.daotabledata
|
|
|
if (!this.seldatblevalue[i].type) {
|
|
if (!this.seldatblevalue[i].type) {
|
|
|
- return '请将信息填写完整';
|
|
|
|
|
|
|
+ return '请将信息填写完整'
|
|
|
} else if (!this.seldatblevalue[i].value) {
|
|
} else if (!this.seldatblevalue[i].value) {
|
|
|
- return '请将信息填写完整';
|
|
|
|
|
- } else if (
|
|
|
|
|
- this.seldatblevalue[i].type === '2' &&
|
|
|
|
|
- !this.seldatblevalue[i].value2
|
|
|
|
|
- ) {
|
|
|
|
|
- return '请将信息填写完整';
|
|
|
|
|
|
|
+ return '请将信息填写完整'
|
|
|
|
|
+ } else if (this.seldatblevalue[i].type === '2' && !this.seldatblevalue[i].value2) {
|
|
|
|
|
+ return '请将信息填写完整'
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return 'vit';
|
|
|
|
|
|
|
+ return 'vit'
|
|
|
},
|
|
},
|
|
|
yanzheng2() {
|
|
yanzheng2() {
|
|
|
for (var i = 0; i < this.seldatblevalue.length; i++) {
|
|
for (var i = 0; i < this.seldatblevalue.length; i++) {
|
|
|
if (this.seldatblevalue[i].type) {
|
|
if (this.seldatblevalue[i].type) {
|
|
|
- return true;
|
|
|
|
|
|
|
+ return true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return false;
|
|
|
|
|
|
|
+ return false
|
|
|
},
|
|
},
|
|
|
goback() {
|
|
goback() {
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
|
+ this.$router.go(-1)
|
|
|
},
|
|
},
|
|
|
sure_submitdata() {
|
|
sure_submitdata() {
|
|
|
if (this.vit() === 'vit' && this.yanzheng2()) {
|
|
if (this.vit() === 'vit' && this.yanzheng2()) {
|
|
@@ -484,36 +451,36 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
// conf[`${element.tongdao}`] = str;
|
|
// conf[`${element.tongdao}`] = str;
|
|
|
// }
|
|
// }
|
|
|
- let conf = [];
|
|
|
|
|
|
|
+ let conf = []
|
|
|
for (let i = 0; i < this.seldatblevalue.length; i++) {
|
|
for (let i = 0; i < this.seldatblevalue.length; i++) {
|
|
|
- let obj = {};
|
|
|
|
|
- const element = this.seldatblevalue[i];
|
|
|
|
|
- let str = `${element.type}#${element.value}`;
|
|
|
|
|
|
|
+ let obj = {}
|
|
|
|
|
+ const element = this.seldatblevalue[i]
|
|
|
|
|
+ let str = `${element.type}#${element.value}`
|
|
|
if (element.type === '2') {
|
|
if (element.type === '2') {
|
|
|
- str += `&${element.value2}|${element.name}`;
|
|
|
|
|
|
|
+ str += `&${element.value2}|${element.name}`
|
|
|
} else {
|
|
} else {
|
|
|
str += `|${element.name}`
|
|
str += `|${element.name}`
|
|
|
}
|
|
}
|
|
|
- obj[`${element.tongdao}`] = str;
|
|
|
|
|
|
|
+ obj[`${element.tongdao}`] = str
|
|
|
conf.push(obj)
|
|
conf.push(obj)
|
|
|
}
|
|
}
|
|
|
if (this.warnid == '') {
|
|
if (this.warnid == '') {
|
|
|
// //console.log('创建');
|
|
// //console.log('创建');
|
|
|
- this.submitdata_found(conf);
|
|
|
|
|
|
|
+ this.submitdata_found(conf)
|
|
|
} else {
|
|
} else {
|
|
|
// //console.log('修改');
|
|
// //console.log('修改');
|
|
|
- this.submitdata_amend(conf);
|
|
|
|
|
|
|
+ this.submitdata_amend(conf)
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: this.vit() === 'vit' ? '请开启至少一个通道预警' : this.vit(),
|
|
message: this.vit() === 'vit' ? '请开启至少一个通道预警' : this.vit(),
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
submitdata_amend(conf) {
|
|
submitdata_amend(conf) {
|
|
|
- //console.log(this.seldatblevalue);
|
|
|
|
|
|
|
+ // console.log(this.seldatblevalue);
|
|
|
this.$axios({
|
|
this.$axios({
|
|
|
method: 'POST',
|
|
method: 'POST',
|
|
|
url: '/api/api_gateway?method=device.device_sms_alert.create_qxz_warning_config',
|
|
url: '/api/api_gateway?method=device.device_sms_alert.create_qxz_warning_config',
|
|
@@ -522,26 +489,26 @@ export default {
|
|
|
device_id: this.qxzoption.device_id,
|
|
device_id: this.qxzoption.device_id,
|
|
|
warning_id: this.warnid,
|
|
warning_id: this.warnid,
|
|
|
device_type: this.device_type,
|
|
device_type: this.device_type,
|
|
|
- conf: JSON.stringify(conf),
|
|
|
|
|
- send_user_id: this.qxzoption.send_user_id.join(','),
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ conf: JSON.stringify(conf)
|
|
|
|
|
+ // send_user_id: this.qxzoption.send_user_id.join(',')
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- //console.log(res);
|
|
|
|
|
|
|
+ // console.log(res);
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '设备预警配置成功',
|
|
message: '设备预警配置成功',
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
- this.goback();
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
|
|
+ this.goback()
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
submitdata_found(conf) {
|
|
submitdata_found(conf) {
|
|
|
this.$axios({
|
|
this.$axios({
|
|
@@ -552,52 +519,52 @@ export default {
|
|
|
device_type_id: this.device_type,
|
|
device_type_id: this.device_type,
|
|
|
device_type: this.device_type,
|
|
device_type: this.device_type,
|
|
|
device_id: this.qxzoption.device_id,
|
|
device_id: this.qxzoption.device_id,
|
|
|
- conf: JSON.stringify(conf),
|
|
|
|
|
- send_user_id: this.qxzoption.send_user_id.join(','),
|
|
|
|
|
- }),
|
|
|
|
|
|
|
+ conf: JSON.stringify(conf)
|
|
|
|
|
+ // send_user_id: this.qxzoption.send_user_id.join(',')
|
|
|
|
|
+ })
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
if (res.data.message == '') {
|
|
if (res.data.message == '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '添加成功',
|
|
message: '添加成功',
|
|
|
type: 'success',
|
|
type: 'success',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
- this.goback();
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
|
|
+ this.goback()
|
|
|
} else {
|
|
} else {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: res.data.message,
|
|
message: res.data.message,
|
|
|
type: 'warning',
|
|
type: 'warning',
|
|
|
- duration: 1500,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ duration: 1500
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
- beforeCreate() {}, //生命周期 - 创建之前
|
|
|
|
|
- //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
|
|
|
|
+ beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
created() {
|
|
|
this.device_type = this.$route.query.typeId
|
|
this.device_type = this.$route.query.typeId
|
|
|
- this.device_idslist = [];
|
|
|
|
|
- this.getbaselist();
|
|
|
|
|
- this.getuserlistdata();
|
|
|
|
|
|
|
+ this.device_idslist = []
|
|
|
|
|
+ this.getbaselist()
|
|
|
|
|
+ this.getuserlistdata()
|
|
|
if (this.$route.query.id) {
|
|
if (this.$route.query.id) {
|
|
|
- this.warnid = this.$route.query.id;
|
|
|
|
|
- this.getqxzwarninfo();
|
|
|
|
|
|
|
+ this.warnid = this.$route.query.id
|
|
|
|
|
+ this.getqxzwarninfo()
|
|
|
} else {
|
|
} else {
|
|
|
- this.warnid = '';
|
|
|
|
|
|
|
+ this.warnid = ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- beforeMount() {}, //生命周期 - 挂载之前
|
|
|
|
|
- //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
|
|
|
|
+ beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
mounted() {
|
|
|
// this.getqxzwarninfo();
|
|
// this.getqxzwarninfo();
|
|
|
},
|
|
},
|
|
|
- beforeUpdate() {}, //生命周期 - 更新之前
|
|
|
|
|
- updated() {}, //生命周期 - 更新之后
|
|
|
|
|
- beforeDestroy() {}, //生命周期 - 销毁之前
|
|
|
|
|
- destroyed() {}, //生命周期 - 销毁完成
|
|
|
|
|
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
|
|
+ updated() {}, // 生命周期 - 更新之后
|
|
|
|
|
+ beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
|
|
+ destroyed() {}, // 生命周期 - 销毁完成
|
|
|
|
|
+ activated() {} // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
.warningsetbox {
|
|
.warningsetbox {
|
|
@@ -664,4 +631,4 @@ export default {
|
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|