Merge branch 'bjxz-rain' of http://139.9.66.234:18023/dhp/zhgdyun into bjxz-rain
This commit is contained in:
commit
77efebf4b7
@ -22,7 +22,7 @@ export default {
|
||||
edit: '编辑电箱设备',
|
||||
add: '新增电箱设备',
|
||||
},
|
||||
rules: {devName: '请输入设备名称'},
|
||||
rules: {devName: '请输入设备名称',devSn: "请输入设备编号(MN码)"},
|
||||
isClosedArr: ['在线', '离线'],
|
||||
voltageA: 'A相相电压阈值',
|
||||
voltageB: 'B相相电压阈值',
|
||||
|
||||
@ -1,24 +1,39 @@
|
||||
<template>
|
||||
<div class="fullHeight">
|
||||
<div class="searchBox whiteBlock">
|
||||
<el-button type="warning" size="medium" plain @click="refresh">{{$t('message.alarmValueSet.refresh')}}</el-button>
|
||||
<el-button type="primary" size="medium" @click="add">{{$t('message.alarmValueSet.add')}}</el-button>
|
||||
<el-button type="warning" size="medium" plain @click="refresh">{{
|
||||
$t("message.alarmValueSet.refresh")
|
||||
}}</el-button>
|
||||
<el-button type="primary" size="medium" @click="add">{{
|
||||
$t("message.alarmValueSet.add")
|
||||
}}</el-button>
|
||||
<!-- <span class="downloadBtn primaryText" @click="downloadFn">
|
||||
{{$t('message.alarmValueSet.protocolDownload')}}
|
||||
</span> -->
|
||||
|
||||
</div>
|
||||
<div class="table_wrap whiteBlock">
|
||||
<vue-scroll style="height: 98%">
|
||||
<el-table class="tables" :data="List">
|
||||
<el-table-column width="200" prop="devName" align="center"
|
||||
<el-table-column
|
||||
width="200"
|
||||
prop="devName"
|
||||
align="center"
|
||||
:label="$t('message.alarmValueSet.deviceName')"
|
||||
></el-table-column>
|
||||
|
||||
<el-table-column prop="devSn" :label="$t('message.alarmValueSet.deviceId')"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column prop="isClosed" :label="$t('message.alarmValueSet.isClosed')"
|
||||
align="center">
|
||||
<template slot-scope="scope">{{scope.row.devOnline==1?'在线':'离线'}}</template>
|
||||
<el-table-column
|
||||
prop="devSn"
|
||||
:label="$t('message.alarmValueSet.deviceId')"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="isClosed"
|
||||
:label="$t('message.alarmValueSet.isClosed')"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">{{
|
||||
scope.row.devOnline == 1 ? "在线" : "离线"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="address" width="100" :label="$t('message.alarmValueSet.address')"
|
||||
align="center"></el-table-column>
|
||||
@ -26,7 +41,9 @@
|
||||
:label="$t('message.alarmValueSet.createTime')"
|
||||
align="center"></el-table-column> -->
|
||||
<el-table-column
|
||||
:label="$t('message.alarmValueSet.operation')" align="center">
|
||||
:label="$t('message.alarmValueSet.operation')"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div class="tableBtns">
|
||||
<!--<div @click="yu(scope.row)" class="operationText"><img src="@/assets/images/yu.png" alt="">{{$t('message.alarmValueSet.yjz')}}
|
||||
@ -34,30 +51,59 @@
|
||||
<div @click="bao(scope.row)" class="operationText"><img src="@/assets/images/bao.png" alt="">{{$t('message.alarmValueSet.bjz')}}
|
||||
</div>-->
|
||||
<div @click="edit(scope.row)" class="operationText">
|
||||
<img src="@/assets/images/icon-edit.png" width="15px" height="15px"/>
|
||||
<span>{{$t('message.alarmValueSet.edit')}}</span>
|
||||
<img
|
||||
src="@/assets/images/icon-edit.png"
|
||||
width="15px"
|
||||
height="15px"
|
||||
/>
|
||||
<span>{{ $t("message.alarmValueSet.edit") }}</span>
|
||||
</div>
|
||||
<div @click="deleteDev(scope.row)" class="operationText">
|
||||
<img src="@/assets/images/icon-delete.png" width="15px" height="15px"/>
|
||||
<span>{{$t('message.alarmValueSet.delete')}}</span>
|
||||
<img
|
||||
src="@/assets/images/icon-delete.png"
|
||||
width="15px"
|
||||
height="15px"
|
||||
/>
|
||||
<span>{{ $t("message.alarmValueSet.delete") }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</vue-scroll>
|
||||
</div>
|
||||
<el-dialog @close="close"
|
||||
<el-dialog
|
||||
@close="close"
|
||||
:modal-append-to-body="false"
|
||||
:title="$t('message.alarmValueSet.Popup_title')[Popup.type]"
|
||||
:visible.sync="Popup.show"
|
||||
width="667px">
|
||||
width="667px"
|
||||
>
|
||||
<div class="dialog_content">
|
||||
<el-form v-show="Popup.type === 'add'||Popup.type === 'edit'" size="medium"
|
||||
ref="addEditForm" :model="addEditForm" :rules="addEditRules"
|
||||
label-width="120px" class="dialogFormBox">
|
||||
<el-form-item :label="$t('message.alarmValueSet.dialog_edit.deviceId')+'(MN'+$t('message.alarmValueSet.code')+')'" prop="devSn">
|
||||
<el-input v-model="addEditForm.devSn" :disabled="Popup.type === 'edit'"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"></el-input>
|
||||
<el-form
|
||||
v-show="Popup.type === 'add' || Popup.type === 'edit'"
|
||||
size="medium"
|
||||
ref="addEditForm"
|
||||
:model="addEditForm"
|
||||
:rules="addEditRules"
|
||||
label-width="130px"
|
||||
class="dialogFormBox"
|
||||
>
|
||||
<el-form-item
|
||||
:label="
|
||||
$t('message.alarmValueSet.dialog_edit.deviceId') +
|
||||
'(MN' +
|
||||
$t('message.alarmValueSet.code') +
|
||||
')'
|
||||
"
|
||||
prop="devSn"
|
||||
>
|
||||
<el-input
|
||||
v-model="addEditForm.devSn"
|
||||
:disabled="Popup.type === 'edit'"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"
|
||||
prop="devSn"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!--<el-form-item label="接收时间" prop="realTime">
|
||||
<el-date-picker
|
||||
@ -73,23 +119,32 @@
|
||||
<el-radio :label="1">{{$t('message.alarmValueSet.dialog_edit.isEnableArr')[1]}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('message.alarmValueSet.dialog_edit.name')" prop="devName">
|
||||
<el-input v-model="addEditForm.devName"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"></el-input>
|
||||
<el-form-item
|
||||
:label="$t('message.deviceManage.devName')"
|
||||
prop="devName"
|
||||
>
|
||||
<el-input
|
||||
v-model="addEditForm.devName"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="$t('message.alarmValueSet.dialog_edit.address')">
|
||||
<el-input v-model="addEditForm.address"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('message.alarmValueSet.dialog_edit.lng')">
|
||||
<el-input v-model="addEditForm.lng"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"></el-input>
|
||||
<el-input
|
||||
v-model="addEditForm.lng"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('message.alarmValueSet.dialog_edit.lat')">
|
||||
<el-input v-model="addEditForm.lat"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"></el-input>
|
||||
<el-input
|
||||
v-model="addEditForm.lat"
|
||||
:placeholder="$t('message.alarmValueSet.placeholder')"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- 报警推送人-->
|
||||
<!-- 报警推送人-->
|
||||
<!-- <el-form-item :label="$t('message.alarmValueSet.dialog_edit.camera')" >
|
||||
<el-select
|
||||
v-model="addEditForm.videoList"
|
||||
@ -107,14 +162,18 @@
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="$t('message.alarmValueSet.dialog_edit.pusher')">
|
||||
<el-select v-model="addEditForm.alarmPushWorkerId" multiple
|
||||
<el-select
|
||||
v-model="addEditForm.alarmPushWorkerId"
|
||||
multiple
|
||||
filterable
|
||||
:placeholder="$t('message.alarmValueSet.placeholder_select')">
|
||||
:placeholder="$t('message.alarmValueSet.placeholder_select')"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.workerId"
|
||||
:label="item.workerName"
|
||||
:value="item.workerId">
|
||||
:value="item.workerId"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -124,14 +183,14 @@
|
||||
@click="Popup.show = false"
|
||||
icon="el-icon-circle-close"
|
||||
size="medium"
|
||||
>{{$t('message.alarmValueSet.cancel')}}
|
||||
>{{ $t("message.alarmValueSet.cancel") }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-circle-check"
|
||||
@click="submit"
|
||||
size="medium"
|
||||
>{{$t('message.alarmValueSet.save')}}
|
||||
>{{ $t("message.alarmValueSet.save") }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
@ -140,16 +199,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
import {
|
||||
rainDevAdd,
|
||||
rainDevEdit,
|
||||
rainDevDelete,
|
||||
rainDevList, getLaborManagementInfoList
|
||||
} from '../../../assets/js/api/rainfallManage'
|
||||
import {
|
||||
getVideoItemListApi,
|
||||
} from "@/assets/js/api/lifter";
|
||||
export default {
|
||||
rainDevList,
|
||||
getLaborManagementInfoList,
|
||||
} from "../../../assets/js/api/rainfallManage";
|
||||
import { getVideoItemListApi } from "@/assets/js/api/lifter";
|
||||
export default {
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getLaborManagementList();
|
||||
@ -158,20 +216,40 @@
|
||||
data() {
|
||||
return {
|
||||
props: {
|
||||
multiple: true
|
||||
multiple: true,
|
||||
},
|
||||
addEditRules: {
|
||||
devSn: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("message.deviceManage.rules.devSn"),
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("message.deviceManage.rules.devSn"),
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
devName: [
|
||||
{required: true, message: this.$t('message.deviceManage.rules.devName'), trigger: "blur"},
|
||||
{required: true, message: this.$t('message.deviceManage.rules.devName'), trigger: "change"}
|
||||
]
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("message.deviceManage.rules.devName"),
|
||||
trigger: "blur",
|
||||
},
|
||||
{
|
||||
required: true,
|
||||
message: this.$t("message.deviceManage.rules.devName"),
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
options: [
|
||||
/*{realName: "曾祥万", value: 1},
|
||||
{realName: "李先生", value: 2},*/
|
||||
],
|
||||
addEditForm: {
|
||||
isEnable: 0
|
||||
isEnable: 0,
|
||||
},
|
||||
List: [
|
||||
/*{
|
||||
@ -183,82 +261,103 @@
|
||||
}*/
|
||||
],
|
||||
Popup: {
|
||||
type: 'add',
|
||||
show: false
|
||||
type: "add",
|
||||
show: false,
|
||||
},
|
||||
videoList:[],
|
||||
}
|
||||
videoList: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
downloadFn(){
|
||||
downloadFn() {
|
||||
// 环境对接协议
|
||||
window.open('/doc/'+this.$t('message.alarmValueSet.envDockingProtocol')+'.zip')
|
||||
window.open(
|
||||
"/doc/" + this.$t("message.alarmValueSet.envDockingProtocol") + ".zip"
|
||||
);
|
||||
},
|
||||
handle(type, show) {//打开弹窗前的统一处理
|
||||
handle(type, show) {
|
||||
//打开弹窗前的统一处理
|
||||
this.Popup = {
|
||||
type: type,
|
||||
show: show
|
||||
}
|
||||
},
|
||||
Change() {
|
||||
show: show,
|
||||
};
|
||||
},
|
||||
Change() {},
|
||||
add() {
|
||||
this.handle('add', true);
|
||||
this.handle("add", true);
|
||||
},
|
||||
//获取摄像机列表
|
||||
getVideoItemList() {
|
||||
let data = {
|
||||
projectSn: this.$store.state.projectSn,
|
||||
};
|
||||
console.log(data)
|
||||
console.log(data);
|
||||
getVideoItemListApi(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
console.log(res)
|
||||
console.log(res);
|
||||
this.videoList = res.result.list;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
edit(obj) {
|
||||
console.log('编辑', obj);
|
||||
console.log("编辑", obj);
|
||||
this.addEditForm = JSON.parse(JSON.stringify(obj));
|
||||
console.log(this.addEditForm)
|
||||
console.log(this.addEditForm);
|
||||
// let videoArr = []
|
||||
// this.addEditForm.videoList && this.addEditForm.videoList.forEach(x=>{
|
||||
// videoArr.push(x.videoItemId)
|
||||
// })
|
||||
// this.addEditForm.videoList = videoArr
|
||||
if (typeof obj.alarmPushWorkerId === 'string'&& obj.alarmPushWorkerId != '') {
|
||||
this.addEditForm.alarmPushWorkerId = obj.alarmPushWorkerId.split(',')
|
||||
if (
|
||||
typeof obj.alarmPushWorkerId === "string" &&
|
||||
obj.alarmPushWorkerId != ""
|
||||
) {
|
||||
this.addEditForm.alarmPushWorkerId = obj.alarmPushWorkerId.split(",");
|
||||
}
|
||||
this.handle('edit', true);
|
||||
this.handle("edit", true);
|
||||
},
|
||||
deleteDev(obj) {
|
||||
console.log('删除', obj);
|
||||
this.$confirm(this.$t('message.personnelPosition.beaconManage.table.confirmText') + "【" + obj.devName + "】?", this.$t('message.personnelPosition.beaconManage.table.Tips'), {
|
||||
confirmButtonText: this.$t('message.personnelPosition.confirmButtonText'),
|
||||
cancelButtonText: this.$t('message.personnelPosition.cancelButtonText'),
|
||||
console.log("删除", obj);
|
||||
this.$confirm(
|
||||
this.$t("message.personnelPosition.beaconManage.table.confirmText") +
|
||||
"【" +
|
||||
obj.devName +
|
||||
"】?",
|
||||
this.$t("message.personnelPosition.beaconManage.table.Tips"),
|
||||
{
|
||||
confirmButtonText: this.$t(
|
||||
"message.personnelPosition.confirmButtonText"
|
||||
),
|
||||
cancelButtonText: this.$t(
|
||||
"message.personnelPosition.cancelButtonText"
|
||||
),
|
||||
type: "warning",
|
||||
}).then(() => {
|
||||
rainDevDelete({id: obj.id}).then(result => {
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
rainDevDelete({ id: obj.id }).then((result) => {
|
||||
if (result.success) {
|
||||
this.$message.success(result.message);
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.addEditForm.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(this.addEditForm)
|
||||
console.log(this.addEditForm);
|
||||
let params = JSON.parse(JSON.stringify(this.addEditForm));
|
||||
console.log(params)
|
||||
if(this.addEditForm.alarmPushWorkerId&&this.addEditForm.alarmPushWorkerId.length>0){
|
||||
params.alarmPushWorkerId = this.addEditForm.alarmPushWorkerId.join(',');
|
||||
}else{
|
||||
params.alarmPushWorkerId = ''
|
||||
console.log(params);
|
||||
if (
|
||||
this.addEditForm.alarmPushWorkerId &&
|
||||
this.addEditForm.alarmPushWorkerId.length > 0
|
||||
) {
|
||||
params.alarmPushWorkerId =
|
||||
this.addEditForm.alarmPushWorkerId.join(",");
|
||||
} else {
|
||||
params.alarmPushWorkerId = "";
|
||||
}
|
||||
// let videoArr = []
|
||||
// for (let i = 0; i < params.videoList.length; i++) {
|
||||
@ -267,21 +366,21 @@
|
||||
// }
|
||||
// params.videoList = videoArr
|
||||
params.projectSn = this.$store.state.projectSn;
|
||||
if (this.Popup.type === 'add') {
|
||||
rainDevAdd(params).then(result => {
|
||||
if (this.Popup.type === "add") {
|
||||
rainDevAdd(params).then((result) => {
|
||||
if (result.success) {
|
||||
this.$message.success(result.message);
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
} else if (this.Popup.type === 'edit') {
|
||||
console.log('编辑信息', this.addEditForm)
|
||||
rainDevEdit(params).then(result => {
|
||||
});
|
||||
} else if (this.Popup.type === "edit") {
|
||||
console.log("编辑信息", this.addEditForm);
|
||||
rainDevEdit(params).then((result) => {
|
||||
if (result.success) {
|
||||
this.$message.success(result.message);
|
||||
this.getList();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
this.Popup.show = false;
|
||||
} else {
|
||||
@ -293,49 +392,57 @@
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
rainDevList({projectSn: this.$store.state.projectSn}).then(result => {
|
||||
rainDevList({ projectSn: this.$store.state.projectSn }).then((result) => {
|
||||
if (result.success) {
|
||||
this.List = result.result;
|
||||
console.log('列表', result);
|
||||
console.log("列表", result);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
close() {
|
||||
this.addEditForm = {
|
||||
isEnable: 0
|
||||
}
|
||||
isEnable: 0,
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addEditForm.clearValidate();
|
||||
})
|
||||
});
|
||||
},
|
||||
getLaborManagementList() {
|
||||
getLaborManagementInfoList({projectSn: this.$store.state.projectSn, workerName: ''}).then(result => {
|
||||
getLaborManagementInfoList({
|
||||
projectSn: this.$store.state.projectSn,
|
||||
workerName: "",
|
||||
}).then((result) => {
|
||||
if (result.success) {
|
||||
console.log('施工人员', result);
|
||||
console.log("施工人员", result);
|
||||
this.options = result.result;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.tableBtns {
|
||||
<style lang="less" scope>
|
||||
.tables{
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
height: auto;
|
||||
}
|
||||
.tableBtns {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
.yj-dialogFormBox {
|
||||
.yj-dialogFormBox {
|
||||
width: 462px;
|
||||
}
|
||||
.searchBox{
|
||||
}
|
||||
.searchBox {
|
||||
position: relative;
|
||||
}
|
||||
.downloadBtn{
|
||||
}
|
||||
.downloadBtn {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
top: 30px;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -19,49 +19,55 @@
|
||||
:value="index">
|
||||
</el-option>
|
||||
</el-select> -->
|
||||
<el-select v-model="queryInfo.deviceId" size="medium"
|
||||
:placeholder="$t('message.alarmWarning.deviceId')">
|
||||
<el-select
|
||||
v-model="queryInfo.deviceId"
|
||||
size="medium"
|
||||
:placeholder="$t('message.alarmWarning.deviceId')"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in deviceIdArr"
|
||||
:key="item.id"
|
||||
:label="item.devName"
|
||||
:value="item.devSn">
|
||||
:value="item.devSn"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-date-picker
|
||||
v-model="time" size="medium"
|
||||
v-model="time"
|
||||
size="medium"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
:start-placeholder="$t('message.alarmWarning.startTime')"
|
||||
:end-placeholder="$t('message.alarmWarning.endTime')">
|
||||
:end-placeholder="$t('message.alarmWarning.endTime')"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-button type="primary" plain size="medium" @click="query">{{$t('message.alarmWarning.query')}}</el-button>
|
||||
<el-button type="warning" plain size="medium" @click="refresh">{{$t('message.alarmWarning.refresh')}}</el-button>
|
||||
<el-button type="primary" plain size="medium" @click="query">{{
|
||||
$t("message.alarmWarning.query")
|
||||
}}</el-button>
|
||||
<el-button type="warning" plain size="medium" @click="refresh">{{
|
||||
$t("message.alarmWarning.refresh")
|
||||
}}</el-button>
|
||||
<!-- <el-button type="primary" size="medium">{{$t('message.alarmWarning.dc')}}</el-button> -->
|
||||
</div>
|
||||
<div class="table_wrap whiteBlock">
|
||||
<vue-scroll style="height: 88%">
|
||||
<el-table class="tables" :data="List">
|
||||
<el-table-column prop="type" :label="$t('message.alarmWarning.typeLabel')" align="center" width="100">
|
||||
<template slot-scope="scope">{{$t('message.alarmWarning.typeArr')[scope.row.type]}}</template>
|
||||
</el-table-column>
|
||||
<!-- 报警名称 -->
|
||||
<el-table-column prop="alarmTypeName" :label="$t('message.projectInfo.alarmName')"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column width="200" prop="deviceName" align="center"
|
||||
:label="$t('message.alarmWarning.deviceName')"
|
||||
<el-table-column
|
||||
prop="alarmContent"
|
||||
label="报警内容"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column prop="avgData" :label="$t('message.alarmWarning.avgData')"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column prop="alarmValue" :label="$t('message.alarmWarning.alarmValue')"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column prop="tempAlarmTime" :label="$t('message.alarmWarning.alarmTime')" align="center">
|
||||
<!-- <template slot-scope="scope">{{new Date(scope.row.alarmTime).toLocaleDateString().replace(/\//g,
|
||||
'-')}}
|
||||
</template> -->
|
||||
<el-table-column
|
||||
prop="alarmVal"
|
||||
label="报警值"
|
||||
align="center"
|
||||
></el-table-column>
|
||||
<el-table-column prop="alarmTime" label="报警时间" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="exceedVal" :label="$t('message.alarmWarning.exceed')"
|
||||
align="center"></el-table-column>
|
||||
</el-table>
|
||||
</vue-scroll>
|
||||
<el-pagination
|
||||
class="pagerBox"
|
||||
@size-change="SizeChange"
|
||||
@ -77,64 +83,82 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
import {
|
||||
rainDevList,
|
||||
rainAlarmList,
|
||||
} from '../../../assets/js/api/rainfallManage'
|
||||
} from "../../../assets/js/api/rainfallManage";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
mounted() {
|
||||
this.selectNowDate()
|
||||
this.selectNowDate();
|
||||
this.getList();
|
||||
this.getDevice();
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
time: [],
|
||||
alarmTypeIdArr: [{
|
||||
alarmTypeIdArr: [
|
||||
{
|
||||
value: 0,
|
||||
label: '报警'
|
||||
}, {
|
||||
value: 1,
|
||||
label: '预警'
|
||||
},],
|
||||
deviceIdArr: [],
|
||||
queryInfo: {},
|
||||
pagInfo: {
|
||||
pageNo: 1,//页数
|
||||
pageSize: 10,//条数
|
||||
total: 0,//总条数
|
||||
label: "报警",
|
||||
},
|
||||
List: []
|
||||
}
|
||||
{
|
||||
value: 1,
|
||||
label: "预警",
|
||||
},
|
||||
],
|
||||
deviceIdArr: [],
|
||||
queryInfo: {
|
||||
deviceId: "",
|
||||
},
|
||||
pagInfo: {
|
||||
pageNo: 1, //页数
|
||||
pageSize: 10, //条数
|
||||
total: 0, //总条数
|
||||
},
|
||||
List: [],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 获取当前时间 返回YYYY-MM-DD HH:mm:ss
|
||||
selectNowDate(){
|
||||
selectNowDate() {
|
||||
var date = new Date(),
|
||||
year = date.getFullYear(),
|
||||
month = date.getMonth() + 1,
|
||||
day = date.getDate(),
|
||||
hours = date.getHours(), //获取当前小时数(0-23)
|
||||
minutes = date.getMinutes(),//获取当前分钟数(0-59)
|
||||
seconds = date.getSeconds()
|
||||
minutes = date.getMinutes(), //获取当前分钟数(0-59)
|
||||
seconds = date.getSeconds();
|
||||
month >= 1 && month <= 9 ? (month = "0" + month) : "";
|
||||
day >= 0 && day <= 9 ? (day = "0" + day) : "";
|
||||
hours >= 0 && hours <= 9 ? (hours = "0" + hours) : "";
|
||||
minutes >= 0 && minutes <= 9 ? (minutes = "0" + minutes) : "";
|
||||
seconds >= 0 && seconds <= 9 ? (seconds = "0" + seconds) : "";
|
||||
var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds;
|
||||
var timer = year + '-' + month + '-' + day
|
||||
this.time = [timer,timer]
|
||||
console.log(timer)
|
||||
var timer =
|
||||
year +
|
||||
"-" +
|
||||
month +
|
||||
"-" +
|
||||
day +
|
||||
" " +
|
||||
hours +
|
||||
":" +
|
||||
minutes +
|
||||
":" +
|
||||
seconds;
|
||||
var timer = year + "-" + month + "-" + day;
|
||||
this.time = [timer, timer];
|
||||
console.log(timer);
|
||||
// return timer;
|
||||
},
|
||||
refresh() {
|
||||
this.queryInfo = {};
|
||||
this.queryInfo = {
|
||||
deviceId: "",
|
||||
};
|
||||
this.time = [];
|
||||
this.pagInfo.pageNo = 1;//页数
|
||||
this.pagInfo.pageSize = 10;//条数
|
||||
this.selectNowDate()
|
||||
this.pagInfo.pageNo = 1; //页数
|
||||
this.pagInfo.pageSize = 10; //条数
|
||||
this.selectNowDate();
|
||||
this.getList();
|
||||
},
|
||||
query() {
|
||||
@ -142,28 +166,38 @@
|
||||
this.queryInfo.startTime = this.time[0];
|
||||
this.queryInfo.endTime = this.time[1];
|
||||
this.pagInfo.pageNo = 1;
|
||||
console.log('query', this.queryInfo);
|
||||
console.log("query", this.queryInfo);
|
||||
},
|
||||
getDevice() {
|
||||
rainDevList({projectSn: this.$store.state.projectSn}).then(result => {
|
||||
rainDevList({ projectSn: this.$store.state.projectSn }).then((result) => {
|
||||
if (result.success) {
|
||||
this.deviceIdArr = result.result;
|
||||
console.log('get设备列表', this.deviceIdArr);
|
||||
if (result.result.length > 0) {
|
||||
this.queryInfo.deviceId = result.result[0].devSn;
|
||||
}
|
||||
})
|
||||
console.log("get设备列表", this.deviceIdArr);
|
||||
}
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
let timeObj={
|
||||
startTime: this.time?this.time[0]:'',
|
||||
endTime: this.time?this.time[1]:''
|
||||
}
|
||||
rainAlarmList(Object.assign(this.queryInfo, this.pagInfo, {projectSn: this.$store.state.projectSn},timeObj)).then(result => {
|
||||
let timeObj = {
|
||||
startTime: this.time ? this.time[0] : "",
|
||||
endTime: this.time ? this.time[1] : "",
|
||||
};
|
||||
rainAlarmList(
|
||||
Object.assign(
|
||||
this.queryInfo,
|
||||
this.pagInfo,
|
||||
{ projectSn: this.$store.state.projectSn },
|
||||
timeObj
|
||||
)
|
||||
).then((result) => {
|
||||
if (result.success) {
|
||||
this.List = result.result.records;
|
||||
this.pagInfo.total = result.result.total;
|
||||
console.log('列表', result);
|
||||
console.log("列表", result);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
SizeChange(val) {
|
||||
this.pagInfo.pageSize = val;
|
||||
@ -173,11 +207,19 @@
|
||||
this.pagInfo.pageNo = val;
|
||||
this.getList();
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.searchBox > div {
|
||||
<style lang="less" scope>
|
||||
.searchBox > div {
|
||||
margin-right: 15px;
|
||||
}
|
||||
}
|
||||
.tables {
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
height: auto;
|
||||
}
|
||||
.pagerBox {
|
||||
margin-top: 21px;
|
||||
}
|
||||
</style>
|
||||
@ -4,7 +4,7 @@
|
||||
<div class="search-item">
|
||||
<span>
|
||||
<!-- 设备名称: -->
|
||||
{{ $t('message.projectInfo.devName') + ':' }}
|
||||
{{ $t("message.projectInfo.devName") + ":" }}
|
||||
</span>
|
||||
<!-- 请选择 -->
|
||||
<el-select
|
||||
@ -12,6 +12,7 @@
|
||||
v-model="devSn"
|
||||
size="medium"
|
||||
:placeholder="$t('message.projectInfo.pleaseChoose')"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in devList"
|
||||
@ -43,21 +44,19 @@
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div> -->
|
||||
<el-button size="medium" @click="quertData">
|
||||
<!-- 查询 -->
|
||||
{{ $t('message.projectInfo.query') }}
|
||||
</el-button>
|
||||
<el-button size="medium" @click="refresh">
|
||||
<!-- 刷新 -->
|
||||
{{ $t('message.projectInfo.fresh') }}
|
||||
</el-button>
|
||||
<el-button type="primary" plain size="medium" @click="quertData">{{
|
||||
$t("message.alarmWarning.query")
|
||||
}}</el-button>
|
||||
<el-button type="warning" plain size="medium" @click="refresh">{{
|
||||
$t("message.alarmWarning.refresh")
|
||||
}}</el-button>
|
||||
<!-- <el-button size="medium" @click="exportExcel">导出</el-button> -->
|
||||
</div>
|
||||
<div class="table-box">
|
||||
<vue-scroll style="height: 88%">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
class="tables"
|
||||
height="320"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
@ -83,12 +82,14 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
width="200"
|
||||
:label="$t('当前雨量(今日雨量)mm')"
|
||||
prop="currentRainfall"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
width="200"
|
||||
:label="$t('日雨量(昨日雨量)mm')"
|
||||
prop="dailyRainfall"
|
||||
>
|
||||
@ -148,6 +149,7 @@
|
||||
>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</vue-scroll>
|
||||
<el-pagination
|
||||
class="pagerBox"
|
||||
@size-change="handleSizeChange"
|
||||
@ -167,8 +169,8 @@
|
||||
import moment from "moment";
|
||||
import {
|
||||
rainRecordPageApi,
|
||||
rainDevList
|
||||
} from '../../../assets/js/api/rainfallManage'
|
||||
rainDevList,
|
||||
} from "../../../assets/js/api/rainfallManage";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -182,29 +184,29 @@ export default {
|
||||
timeList: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
valueTime: []
|
||||
}
|
||||
valueTime: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.projectSn = this.$store.state.projectSn;
|
||||
this.startTime = this.endTime = moment(new Date()).format('YYYY-MM-DD')
|
||||
console.log(this.startTime, this.endTime)
|
||||
this.getDevice()
|
||||
this.selectNowDate()
|
||||
this.selectDustNoisePageList()
|
||||
this.startTime = this.endTime = moment(new Date()).format("YYYY-MM-DD");
|
||||
console.log(this.startTime, this.endTime);
|
||||
this.getDevice();
|
||||
this.selectNowDate();
|
||||
this.selectDustNoisePageList();
|
||||
},
|
||||
|
||||
methods: {
|
||||
getDevice() {
|
||||
rainDevList({ projectSn: this.$store.state.projectSn }).then(result => {
|
||||
rainDevList({ projectSn: this.$store.state.projectSn }).then((result) => {
|
||||
if (result.success) {
|
||||
this.devList = result.result;
|
||||
if (result.result.length > 0) {
|
||||
this.devSn = result.result[0].devSn
|
||||
this.devSn = result.result[0].devSn;
|
||||
}
|
||||
console.log('get设备列表', this.devList);
|
||||
console.log("get设备列表", this.devList);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
// 获取当前时间 返回YYYY-MM-DD HH:mm:ss
|
||||
selectNowDate() {
|
||||
@ -213,17 +215,17 @@ export default {
|
||||
month = date.getMonth() + 1,
|
||||
day = date.getDate(),
|
||||
hours = date.getHours(), //获取当前小时数(0-23)
|
||||
minutes = date.getMinutes(),//获取当前分钟数(0-59)
|
||||
seconds = date.getSeconds()
|
||||
minutes = date.getMinutes(), //获取当前分钟数(0-59)
|
||||
seconds = date.getSeconds();
|
||||
month >= 1 && month <= 9 ? (month = "0" + month) : "";
|
||||
day >= 0 && day <= 9 ? (day = "0" + day) : "";
|
||||
hours >= 0 && hours <= 9 ? (hours = "0" + hours) : "";
|
||||
minutes >= 0 && minutes <= 9 ? (minutes = "0" + minutes) : "";
|
||||
seconds >= 0 && seconds <= 9 ? (seconds = "0" + seconds) : "";
|
||||
// var timer = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes+ ':' + seconds;
|
||||
var timer = year + '-' + month + '-' + day
|
||||
this.valueTime = [timer, timer]
|
||||
console.log(timer)
|
||||
var timer = year + "-" + month + "-" + day;
|
||||
this.valueTime = [timer, timer];
|
||||
console.log(timer);
|
||||
// return timer;
|
||||
},
|
||||
selectDustNoisePageList() {
|
||||
@ -232,56 +234,64 @@ export default {
|
||||
projectSn: this.$store.state.projectSn,
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
startTime: this.valueTime ? this.valueTime[0] : '',
|
||||
endTime: this.valueTime ? this.valueTime[1] : ''
|
||||
}
|
||||
rainRecordPageApi(data).then(res => {
|
||||
console.log(res)
|
||||
startTime: this.valueTime ? this.valueTime[0] : "",
|
||||
endTime: this.valueTime ? this.valueTime[1] : "",
|
||||
};
|
||||
rainRecordPageApi(data).then((res) => {
|
||||
console.log(res);
|
||||
if (res.success) {
|
||||
this.tableData = res.result.records
|
||||
this.total = res.result.total
|
||||
this.tableData = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
//刷新
|
||||
refresh() {
|
||||
this.pageNo = 1
|
||||
this.pageSize = 10
|
||||
this.valueTime = []
|
||||
this.selectNowDate()
|
||||
this.selectDustNoisePageList()
|
||||
this.pageNo = 1;
|
||||
this.pageSize = 10;
|
||||
this.valueTime = [];
|
||||
this.selectNowDate();
|
||||
this.selectDustNoisePageList();
|
||||
},
|
||||
quertData() {
|
||||
this.pageNo = 1
|
||||
this.pageSize = 10
|
||||
console.log(this.devSn)
|
||||
this.selectDustNoisePageList()
|
||||
this.pageNo = 1;
|
||||
this.pageSize = 10;
|
||||
console.log(this.devSn);
|
||||
this.selectDustNoisePageList();
|
||||
},
|
||||
|
||||
handleSizeChange(value) {
|
||||
this.pageSize = value;
|
||||
this.selectDustNoisePageList()
|
||||
this.selectDustNoisePageList();
|
||||
},
|
||||
handleCurrentChange(value) {
|
||||
this.pageNo = value;
|
||||
this.selectDustNoisePageList()
|
||||
this.selectDustNoisePageList();
|
||||
},
|
||||
exportExcel() {
|
||||
if (this.valueTime) {
|
||||
window.location.href =
|
||||
this.$http.defaults.baseURL +
|
||||
"xmgl/download/exporExcelTowerAlarm?projectSn=" + this.projectSn +
|
||||
"&devSn=" + this.devSn + "&startTime=" + this.transformTimestamp2(this.valueTime[0]) + "&endTime=" + this.transformTimestamp2(this.valueTime[1]);
|
||||
"xmgl/download/exporExcelTowerAlarm?projectSn=" +
|
||||
this.projectSn +
|
||||
"&devSn=" +
|
||||
this.devSn +
|
||||
"&startTime=" +
|
||||
this.transformTimestamp2(this.valueTime[0]) +
|
||||
"&endTime=" +
|
||||
this.transformTimestamp2(this.valueTime[1]);
|
||||
} else {
|
||||
window.location.href =
|
||||
this.$http.defaults.baseURL +
|
||||
"xmgl/download/exporExcelTowerAlarm?projectSn=" + this.projectSn +
|
||||
"&devSn=" + this.devSn;
|
||||
"xmgl/download/exporExcelTowerAlarm?projectSn=" +
|
||||
this.projectSn +
|
||||
"&devSn=" +
|
||||
this.devSn;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@ -299,8 +309,16 @@ export default {
|
||||
}
|
||||
}
|
||||
.table-box {
|
||||
flex: 1;
|
||||
height: calc(100% - 99px);
|
||||
background: #fff;
|
||||
.tables{
|
||||
min-height: 0;
|
||||
max-height: none;
|
||||
height: auto;
|
||||
}
|
||||
.pagerBox{
|
||||
margin-top: 21px;
|
||||
}
|
||||
/deep/.el-table {
|
||||
td {
|
||||
// vertical-align: top;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user