| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <template>
- <div
- class="ele-body"
- :style="
- $route.query.isDrawer
- ? {
- position: 'fixed',
- height: '100vh',
- top: '0',
- bottom: '0',
- left: '0',
- right: '0',
- zIndex: 1000,
- background: '#fff'
- }
- : {}
- "
- >
- <el-card shadow="never" v-loading="loading">
- <message-search @search="reload"> </message-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :pageSizes="tablePageSizes"
- :columns="columns"
- :datasource="datasource"
- cache-key="systemRoleTable"
- >
- </ele-pro-table>
- </el-card>
- </div>
- </template>
- <script>
- import MessageSearch from './components/message-search.vue';
- import { alarmlogsheetPage } from '@/api/warning/index.js';
- import dictMixins from '@/mixins/dictMixins';
- export default {
- mixins: [dictMixins],
- components: {
- MessageSearch
- },
- data() {
- return {
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- label: '序号',
- type: 'index',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'alarmLevel',
- label: '告警级别',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110,
- formatter: (_row, _column, cellValue) => {
- const map = {
- 1: '提示',
- 2: '一般',
- 3: '严重',
- 4: '紧急',
- 5: '致命'
- };
- return map[cellValue] || '-';
- }
- },
- {
- prop: 'deviceCode',
- label: '设备编号',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'deviceName',
- label: '设备名称',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'description',
- label: '告警描述',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 180
- },
- {
- prop: 'generateDocumentType',
- label: '生成单据类型',
- formatter: (_row, _column, cellValue) => {
- return cellValue == 1
- ? '巡点检'
- : cellValue == 2
- ? '保养'
- : cellValue == 3
- ? '维修'
- : cellValue == 5
- ? '量具送检'
- : '';
- },
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'generateDocumentCode',
- label: '生成单据编码',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'remark',
- label: '备注',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'alarmTime',
- label: '告警时间',
- align: 'center',
- showOverflowTooltip: true,
- minWidth: 160,
- formatter: (_row, _column, cellValue) => {
- return this.$util.toDateString(cellValue);
- }
- }
- ],
- // 加载状态
- loading: false
- };
- },
- computed: {},
- created() {
- this.requestDict('规则状态');
- },
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return alarmlogsheetPage({
- pageNum: page,
- size: limit,
- ...where
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ page: 1, where, ruleType: 2 });
- }
- }
- };
- </script>
- <style lang="scss" scoped></style>
|