|
|
@@ -1,48 +1,62 @@
|
|
|
<template>
|
|
|
- <div v-loading="downloading" :element-loading-text="$t('message.Load')">
|
|
|
-
|
|
|
- <el-table :data="list" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column
|
|
|
- type="selection"
|
|
|
- width="60"></el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="DeviceName" label="设备名称" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="ChannelCode" label="设备编号" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="ChannelName" label="所属组织" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column prop="SendTo" label="操作人" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column label="开门时间" show-overflow-tooltip>
|
|
|
+ <div v-loading="downloading"
|
|
|
+ :element-loading-text="$t('message.Load')">
|
|
|
+
|
|
|
+ <el-table :data="list"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection"
|
|
|
+ width="60"></el-table-column>
|
|
|
+
|
|
|
+ <el-table-column prop="DeviceName"
|
|
|
+ label="设备名称"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="ChannelCode"
|
|
|
+ label="设备编号"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="ChannelName"
|
|
|
+ label="所属组织"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column prop="SendTo"
|
|
|
+ label="操作人"
|
|
|
+ show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column label="开门时间"
|
|
|
+ show-overflow-tooltip>
|
|
|
<template scope="scope">
|
|
|
{{jstimehandle(scope.row.CreateOn)}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="Message" label="操作状态" show-overflow-tooltip>
|
|
|
+ <el-table-column prop="Message"
|
|
|
+ label="操作状态"
|
|
|
+ show-overflow-tooltip>
|
|
|
<!-- <template scope="scope"> -->
|
|
|
- <template scope="scope">
|
|
|
- <el-tag type="success" >{{'开锁'}}</el-tag>
|
|
|
+ <template scope="scope">
|
|
|
+ <el-tag type="success">{{'开锁'}}</el-tag>
|
|
|
<!-- <el-tag type="danger" v-if="scope.row.issend === 1">{{ $t('message.abnormalsetting.failure') }}</el-tag>
|
|
|
<el-tag type="warning" v-if="scope.row.issend === 2">{{ $t('message.abnormalsetting.Unsent') }}</el-tag> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
+
|
|
|
</el-table>
|
|
|
- <el-pagination
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :current-page="currentPage"
|
|
|
- :page-sizes="[10, 15, 20, 25]"
|
|
|
- :page-size="size"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="currentItemCount">
|
|
|
+ <el-pagination @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :current-page="currentPage"
|
|
|
+ :page-sizes="[10, 15, 20, 25]"
|
|
|
+ :page-size="size"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="currentItemCount">
|
|
|
</el-pagination>
|
|
|
|
|
|
- <el-dialog :title="dialogtitle" :visible.sync="datadialogVisible" top="5%">
|
|
|
+ <el-dialog :title="dialogtitle"
|
|
|
+ :visible.sync="datadialogVisible"
|
|
|
+ top="5%">
|
|
|
<p class="triggerone">{{ $t('message.abnormalsetting.type') }}:{{getetypename(triggerform.eventfiled)}}</p>
|
|
|
<p class="triggerone">{{ $t('message.abnormalsetting.alarm') }}:{{gettypename(triggerform.type)}}</p>
|
|
|
<p class="triggerone">{{ $t('message.abnormalsetting.Device') }}:{{triggerform.cname}}</p>
|
|
|
<p class="triggerone">{{ $t('message.abnormalsetting.object') }}:{{triggerform.sendto}}</p>
|
|
|
<p class="triggerone">{{ $t('message.abnormalsetting.Alarm') }}:{{triggerform.alarmon}}</p>
|
|
|
<p class="triggerone">{{ $t('message.') }}:{{triggerform.message}}</p>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
<el-button @click="datadialogVisible = false">{{ $t('message.users.cancel') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -51,106 +65,168 @@
|
|
|
|
|
|
<script>
|
|
|
import axios from 'axios'
|
|
|
- export default {
|
|
|
- name: 'abnormalmsg',
|
|
|
+export default {
|
|
|
+ name: 'abnormalmsg',
|
|
|
+
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ currentItemCount: 0,
|
|
|
+ currentPage: 1,
|
|
|
+ size: 10,
|
|
|
+ list: [],
|
|
|
+ datadialogVisible: false,
|
|
|
+ dialogtitle: '',
|
|
|
+ triggerform: {
|
|
|
+ eventfiled: '',
|
|
|
+ cname: '',
|
|
|
+ ccode: '',
|
|
|
+ type: '',
|
|
|
+ alarmon: new Date(),
|
|
|
+ sendto: '',
|
|
|
+ message: '',
|
|
|
+ remark: '',
|
|
|
+ id: 0
|
|
|
+ },
|
|
|
+ selectlist: [],
|
|
|
+ seachform: {
|
|
|
+ etype: '',
|
|
|
+ timerange: [new Date(new Date() - 30 * 24 * 3600 * 1000), new Date()],
|
|
|
+ channel: ''
|
|
|
+ },
|
|
|
+ downloading: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ created () {
|
|
|
+ // initial data
|
|
|
+ this.initData(this.$route.query.code)
|
|
|
+ },
|
|
|
|
|
|
- data () {
|
|
|
- return {
|
|
|
- currentItemCount: 0,
|
|
|
- currentPage: 1,
|
|
|
- size: 20,
|
|
|
- list: [],
|
|
|
- datadialogVisible: false,
|
|
|
- dialogtitle: '',
|
|
|
- triggerform: {
|
|
|
- eventfiled: '',
|
|
|
- cname: '',
|
|
|
- ccode: '',
|
|
|
- type: '',
|
|
|
- alarmon: new Date(),
|
|
|
- sendto: '',
|
|
|
- message: '',
|
|
|
- remark: '',
|
|
|
- id: 0
|
|
|
- },
|
|
|
- selectlist: [],
|
|
|
- seachform: {
|
|
|
- etype: '',
|
|
|
- timerange: [new Date(new Date() - 30 * 24 * 3600 * 1000), new Date()],
|
|
|
- channel: ''
|
|
|
- },
|
|
|
- downloading: false
|
|
|
+ methods: {
|
|
|
+ initData (code) {
|
|
|
+ let _this = this
|
|
|
+ // request
|
|
|
+ axios.request({
|
|
|
+ method: 'get',
|
|
|
+ url: 'http://39.98.34.197:12001/api/remote_control/gettriggerhistory?current=' + this.currentPage + '&size=' + this.size + '&code=' + code
|
|
|
+
|
|
|
+ }).then(res => {
|
|
|
+ _this.list = res.data.data.records
|
|
|
+ _this.currentItemCount = res.data.data.total
|
|
|
+ }).catch(error => {
|
|
|
+ console.log(error)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ seachdata () {
|
|
|
+ let value = this.seachform.timerange
|
|
|
+ if (value) {
|
|
|
+ if (value.length === 2 && value[0] !== null) {
|
|
|
+ this.currentPage = 1
|
|
|
+ this.initData(this.$route.query.code)
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: this.$t('message.abnormalsetting.range')
|
|
|
+ })
|
|
|
},
|
|
|
-
|
|
|
- created () {
|
|
|
- // initial data
|
|
|
+ handleSizeChange (value) {
|
|
|
+ this.size = value
|
|
|
+ this.currentPage = 1
|
|
|
this.initData(this.$route.query.code)
|
|
|
},
|
|
|
-
|
|
|
- methods: {
|
|
|
- initData (code) {
|
|
|
- let _this = this
|
|
|
- // request
|
|
|
- axios.request({
|
|
|
- method: 'get',
|
|
|
- url: 'http://39.98.34.197:12001/api/remote_control/gettriggerhistory?current=1&size=20&code=' + code
|
|
|
- }).then(res => {
|
|
|
- _this.list = res.data.data
|
|
|
- console.log('-----res------', res.data.data)
|
|
|
- _this.currentItemCount = res.data.data.length
|
|
|
- }).catch(error => {
|
|
|
- console.log(error)
|
|
|
+ handleCurrentChange (value) {
|
|
|
+ this.currentPage = value
|
|
|
+ this.initData(this.$route.query.code)
|
|
|
+ },
|
|
|
+ jstimehandle (val) {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 19)
|
|
|
+ },
|
|
|
+ opendatadialog (v, index) {
|
|
|
+ this.datadialogVisible = true
|
|
|
+ this.dialogtitle = this.$t('message.abnormalsetting.history')
|
|
|
+ this.triggerform.cname = v.cname
|
|
|
+ this.triggerform.ccode = v.ccode
|
|
|
+ this.triggerform.id = v.id
|
|
|
+ this.triggerform.type = v.type
|
|
|
+ this.triggerform.eventfiled = v.eventfiled
|
|
|
+ this.triggerform.alarmon = v.alarmon
|
|
|
+ this.triggerform.sendto = v.sendto
|
|
|
+ this.triggerform.message = v.message
|
|
|
+ this.triggerform.remark = v.remark
|
|
|
+ },
|
|
|
+ deletedata (val) {
|
|
|
+ let _this = this
|
|
|
+ _this.$confirm(this.$t('message.users.warn'), this.$t('message.users.tip'), {
|
|
|
+ confirmButtonText: this.$t('message.users.confirm'),
|
|
|
+ cancelButtonText: this.$t('message.users.cancel'),
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ _this.$services.abnormal.delete('historymsg/' + val.id, null)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ // 更新界面
|
|
|
+ this.initData()
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- },
|
|
|
- seachdata () {
|
|
|
- let value = this.seachform.timerange
|
|
|
- if (value) {
|
|
|
- if (value.length === 2 && value[0] !== null) {
|
|
|
- this.currentPage = 1
|
|
|
- this.initData()
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: this.$t('message.abnormalsetting.range')
|
|
|
- })
|
|
|
- },
|
|
|
- handleSizeChange (value) {
|
|
|
- this.size = value
|
|
|
- this.currentPage = 1
|
|
|
- this.initData()
|
|
|
- },
|
|
|
- handleCurrentChange (value) {
|
|
|
- this.currentPage = value
|
|
|
- this.initData()
|
|
|
- },
|
|
|
- jstimehandle (val) {
|
|
|
- val = val.replace('T', ' ')
|
|
|
- return val.substring(0, 19)
|
|
|
- },
|
|
|
- opendatadialog (v, index) {
|
|
|
- this.datadialogVisible = true
|
|
|
- this.dialogtitle = this.$t('message.abnormalsetting.history')
|
|
|
- this.triggerform.cname = v.cname
|
|
|
- this.triggerform.ccode = v.ccode
|
|
|
- this.triggerform.id = v.id
|
|
|
- this.triggerform.type = v.type
|
|
|
- this.triggerform.eventfiled = v.eventfiled
|
|
|
- this.triggerform.alarmon = v.alarmon
|
|
|
- this.triggerform.sendto = v.sendto
|
|
|
- this.triggerform.message = v.message
|
|
|
- this.triggerform.remark = v.remark
|
|
|
- },
|
|
|
- deletedata (val) {
|
|
|
- let _this = this
|
|
|
- _this.$confirm(this.$t('message.users.warn'), this.$t('message.users.tip'), {
|
|
|
+ .catch(() => { })
|
|
|
+ }).catch(() => { })
|
|
|
+ },
|
|
|
+ gettypename (val) {
|
|
|
+ if (val === 'email') {
|
|
|
+ return this.$t('message.actions.e-mail')
|
|
|
+ } else if (val === 'url') {
|
|
|
+ return this.$t('message.actions.e-URL')
|
|
|
+ } else if (val === 'alertor') {
|
|
|
+ return this.$t('message.actions.Alarm')
|
|
|
+ } else if (val === 'sms') {
|
|
|
+ return this.$t('message.actions.SMS')
|
|
|
+ } else if (val === 'voice') {
|
|
|
+ return this.$t('message.actions.voice')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getetypename (val) {
|
|
|
+ if (val === 'sensor_abnormal') {
|
|
|
+ return this.$t('message.abnormalsetting.offline')
|
|
|
+ } else if (val === 'alarm_low') {
|
|
|
+ return this.$t('message.abnormalsetting.low')
|
|
|
+ } else if (val === 'alarm_offline') {
|
|
|
+ return this.$t('message.abnormalsetting.Sound')
|
|
|
+ } else if (val === 'sms') {
|
|
|
+ return this.$t('message.abnormalsetting.SMS')
|
|
|
+ } else if (val === 'voice') {
|
|
|
+ return this.$t('message.abnormalsetting.Voice')
|
|
|
+ } else if (val === 'box_low') {
|
|
|
+ return this.$t('message.abnormalsetting.battery')
|
|
|
+ } else if (val === 'box_offline') {
|
|
|
+ return this.$t('message.abnormalsetting.Gateway')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ batchdata () {
|
|
|
+ let _this = this
|
|
|
+ if (_this.selectlist.length > 0) {
|
|
|
+ _this.$confirm(this.$t('message.users.warn'), this.$t('message.users.tip'), {
|
|
|
confirmButtonText: this.$t('message.users.confirm'),
|
|
|
cancelButtonText: this.$t('message.users.cancel'),
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- _this.$services.abnormal.delete('historymsg/' + val.id, null)
|
|
|
+ let ids = []
|
|
|
+ _this.selectlist.forEach(row => {
|
|
|
+ ids.push(row.id)
|
|
|
+ })
|
|
|
+ _this.$services.abnormal.delete('historymsg/batchdelete/' + ids, null)
|
|
|
.then(res => {
|
|
|
// response
|
|
|
if (res.data.code === 0) {
|
|
|
@@ -167,98 +243,40 @@ import axios from 'axios'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
- .catch(() => {})
|
|
|
- }).catch(() => {})
|
|
|
- },
|
|
|
- gettypename (val) {
|
|
|
- if (val === 'email') {
|
|
|
- return this.$t('message.actions.e-mail')
|
|
|
- } else if (val === 'url') {
|
|
|
- return this.$t('message.actions.e-URL')
|
|
|
- } else if (val === 'alertor') {
|
|
|
- return this.$t('message.actions.Alarm')
|
|
|
- } else if (val === 'sms') {
|
|
|
- return this.$t('message.actions.SMS')
|
|
|
- } else if (val === 'voice') {
|
|
|
- return this.$t('message.actions.voice')
|
|
|
- }
|
|
|
- },
|
|
|
- getetypename (val) {
|
|
|
- if (val === 'sensor_abnormal') {
|
|
|
- return this.$t('message.abnormalsetting.offline')
|
|
|
- } else if (val === 'alarm_low') {
|
|
|
- return this.$t('message.abnormalsetting.low')
|
|
|
- } else if (val === 'alarm_offline') {
|
|
|
- return this.$t('message.abnormalsetting.Sound')
|
|
|
- } else if (val === 'sms') {
|
|
|
- return this.$t('message.abnormalsetting.SMS')
|
|
|
- } else if (val === 'voice') {
|
|
|
- return this.$t('message.abnormalsetting.Voice')
|
|
|
- } else if (val === 'box_low') {
|
|
|
- return this.$t('message.abnormalsetting.battery')
|
|
|
- } else if (val === 'box_offline') {
|
|
|
- return this.$t('message.abnormalsetting.Gateway')
|
|
|
- }
|
|
|
- },
|
|
|
- batchdata () {
|
|
|
- let _this = this
|
|
|
- if (_this.selectlist.length > 0) {
|
|
|
- _this.$confirm(this.$t('message.users.warn'), this.$t('message.users.tip'), {
|
|
|
- confirmButtonText: this.$t('message.users.confirm'),
|
|
|
- cancelButtonText: this.$t('message.users.cancel'),
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let ids = []
|
|
|
- _this.selectlist.forEach(row => {
|
|
|
- ids.push(row.id)
|
|
|
- })
|
|
|
- _this.$services.abnormal.delete('historymsg/batchdelete/' + ids, null)
|
|
|
- .then(res => {
|
|
|
- // response
|
|
|
- if (res.data.code === 0) {
|
|
|
- _this.$message({
|
|
|
- type: 'success',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- // 更新界面
|
|
|
- this.initData()
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: res.data.message
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
- }).catch(() => {})
|
|
|
- } else {
|
|
|
- _this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: this.$t('message.users.select')
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.selectlist = val
|
|
|
+ .catch(() => { })
|
|
|
+ }).catch(() => { })
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: this.$t('message.users.select')
|
|
|
+ })
|
|
|
}
|
|
|
+ },
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.selectlist = val
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="css">
|
|
|
- .el-pagination {
|
|
|
- margin: 1rem 0 2rem;
|
|
|
- text-align: right;
|
|
|
- }
|
|
|
- .triggerone {
|
|
|
- font-size: 13px;
|
|
|
- margin-left: 80px;
|
|
|
- }
|
|
|
- .plab {
|
|
|
- font-size: 13px;
|
|
|
- color: #999;
|
|
|
- }
|
|
|
+.el-pagination {
|
|
|
+ margin: 1rem 0 2rem;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+.triggerone {
|
|
|
+ font-size: 13px;
|
|
|
+ margin-left: 80px;
|
|
|
+}
|
|
|
+.plab {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
|
|
|
- ::-webkit-input-placeholder{ color: #7A7A7A; }
|
|
|
- ::-webkit-elinput-placeholder{ color: #7A7A7A; }
|
|
|
+::-webkit-input-placeholder {
|
|
|
+ color: #7a7a7a;
|
|
|
+}
|
|
|
+::-webkit-elinput-placeholder {
|
|
|
+ color: #7a7a7a;
|
|
|
+}
|
|
|
</style>
|