xuhuajiao
8 months ago
3 changed files with 151 additions and 7 deletions
-
15src/views/system/logManage/deviceLog/index.vue
-
7src/views/system/logManage/index.vue
-
136src/views/system/logManage/storeLog/index.vue
@ -0,0 +1,136 @@ |
|||
<template> |
|||
<div> |
|||
<div class="head-container"> |
|||
<!-- <crudOperation /> --> |
|||
<!-- <el-button v-permission="permission.download" :loading="crud.downloadLoading" :disabled="!selections.length" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> --> |
|||
<!-- <el-button :loading="crud.downloadLoading" size="mini" icon="el-icon-download" @click="handleDownload">导出</el-button> --> |
|||
<!-- <el-input |
|||
v-model="keyWord" |
|||
size="small" |
|||
clearable |
|||
placeholder="请输入关键词" |
|||
style="width: 300px;margin-right:10px;padding-left:10px" |
|||
class="input-prepend filter-item" |
|||
@keyup.enter.native="crud.toQuery" |
|||
> |
|||
<el-select slot="prepend" v-model="optionVal" style="width: 80px"> |
|||
<el-option |
|||
v-for="item in options" |
|||
:key="item.value" |
|||
:label="item.label" |
|||
:value="item.value" |
|||
/> |
|||
</el-select> |
|||
</el-input> --> |
|||
<date-range-picker v-model="queryTime" class="date-item" /> |
|||
<rrOperation /> |
|||
</div> |
|||
<el-table |
|||
ref="table" |
|||
:data="crud.data" |
|||
style="width: 100%;" |
|||
height="calc(100vh - 356px)" |
|||
:cell-class-name="cell" |
|||
@row-click="clickRowHandler" |
|||
@selection-change="selectionChangeHandler" |
|||
> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column prop="storeCode" label="库房" align="center" min-width="150"> |
|||
<template> |
|||
<div>5F档案库</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="temperature" label="温度" align="center" /> |
|||
<el-table-column prop="humidity" label="湿度" align="center" /> |
|||
<el-table-column prop="co2" label="二氧化碳" align="center" /> |
|||
<el-table-column prop="pm25" label="PM2.5" align="center" /> |
|||
<el-table-column prop="pm10" label="PM10" align="center" /> |
|||
<el-table-column prop="tvoc" label="TVOC" align="center" /> |
|||
<el-table-column prop="update_time" label="发生时间" align="center" min-width="180"> |
|||
<template slot-scope="scope"> |
|||
<div>{{ scope.row.update_time | parseTime }}</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<pagination /> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import rrOperation from '@crud/RR.operation' |
|||
import CRUD, { presenter, crud } from '@crud/crud' |
|||
import DateRangePicker from '@/components/DateRangePicker' |
|||
import pagination from '@crud/Pagination' |
|||
import { parseTime, saveAs, getBlob } from '@/utils/index' |
|||
import { mapGetters } from 'vuex' |
|||
import qs from 'qs' |
|||
export default { |
|||
name: 'StoreLog', |
|||
components: { rrOperation, DateRangePicker, pagination }, |
|||
mixins: [presenter(), crud()], |
|||
cruds() { |
|||
return CRUD({ |
|||
url: 'api/device/initEnvironmentControlLog', |
|||
optShow: { |
|||
add: false, |
|||
edit: false, |
|||
del: false, |
|||
download: true |
|||
}, |
|||
sort: [] |
|||
}) |
|||
}, |
|||
data() { |
|||
return { |
|||
selections: [], |
|||
queryTime: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapGetters([ |
|||
'baseApi' |
|||
]) |
|||
}, |
|||
methods: { |
|||
[CRUD.HOOK.beforeRefresh]() { |
|||
this.crud.query.startTime = null |
|||
this.crud.query.endTime = null |
|||
if (this.queryTime && this.queryTime.length !== 0) { |
|||
this.crud.query.startTime = this.queryTime[0] |
|||
this.crud.query.endTime = this.queryTime[1] |
|||
} else { |
|||
this.crud.query.startTime = null |
|||
this.crud.query.endTime = null |
|||
} |
|||
}, |
|||
// 导出 |
|||
handleDownload() { |
|||
this.crud.downloadLoading = true |
|||
const fileName = parseTime(new Date()) + '-库房环控日志.xlsx' |
|||
getBlob(this.baseApi + '/api/securitydoor/exportSecurityDoorLog1List' + '?' + qs.stringify(this.crud.query, { indices: false }), function(blob) { |
|||
saveAs(blob, fileName) |
|||
}) |
|||
this.crud.downloadLoading = false |
|||
}, |
|||
clickRowHandler(row) { |
|||
this.$refs.table.toggleRowSelection(row) // 单击选中 |
|||
}, |
|||
selectionChangeHandler(val) { |
|||
this.selections = val |
|||
}, |
|||
cell({ row, columnIndex }) { |
|||
if (row.alarmLevel === 1 && columnIndex === 2) { |
|||
return 'have-clear' |
|||
} else if (row.alarmLevel === 0 && columnIndex === 2) { |
|||
return 'fail-clear' |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
@import '~@/assets/styles/lend-manage.scss'; |
|||
@import "~@/assets/styles/archives-manage.scss"; |
|||
|
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue