lius
2023-06-08 c66a22e4b6bb02667a5000f2e04aeb4ef5ae44c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<template>
  <a-card :bordered="false">
    <!-- table区域-begin -->
    <div class="table_logList">
      <a-table ref="table" bordered size="middle" :rowKey="(record,index)=>{return index}" :columns="columns"
               :dataSource="dataList" :pagination="ipagination" :loading="loadingequip"  @change="handleTableChange">
        <template slot="status" slot-scope="status">
          <div v-if="status == '3' || status ==  '23'" style="color: #00ee00;width: 100%; height: 100%;">运行</div>
          <div v-else-if="status == '1' || status == '2'" style="color: #ffea91;width: 100%; height: 100%;">待机</div>
          <div v-else-if="status == '0'" style="color: #A8A8A8;width: 100%; height: 100%;">关机</div>
          <div v-else-if="status == '22'" style="color: red;width: 100%; height: 100%;">报警</div>
        </template>
      </a-table>
    </div>
  </a-card>
</template>
 
<script>
  import JDictSelectTag from '@/components/dict/JDictSelectTag'
  import {
    requestPut,
    deleteAction
  } from '@/api/manage'
 
  import JInput from '@/components/jeecg/JInput'
  import JEllipsis from '@/components/jeecg/JEllipsis'
  import Tooltip from 'ant-design-vue/es/tooltip'
  import {
    JeecgListMixin
  } from '@/mixins/JeecgListMixin'
  export default {
    name: 'LogList',
    mixins: [JeecgListMixin],
    components: {
      Tooltip,
      JDictSelectTag,
      JInput,
      JEllipsis
    },
    props: {
      dataList: {
        type: Array,
        required: true,
        default: []
      },
      loadingequip:{
        type:Boolean,
        default: false
      }
    },
    data() {
      return {
        statusName: '',
        disabled: true,
        disableMixinCreated: true,
        loading: false,
        ipagination:{
          current: 1,
          pageSize: 100,
          pageSizeOptions: ['100', '500', '1000'],
          showTotal: (total, range) => {
            return range[0] + "-" + range[1] + " 共" + total + "条"
          },
          showQuickJumper: true,
          showSizeChanger: true,
          total: 0
        },
        columns: [
          {
            title: '状态',
            align: 'center',
            dataIndex: 'status',
            scopedSlots: { customRender: 'status' }
          },
          {
            title: '开始时间',
            align: 'center',
            dataIndex: 'startTime',
            // defaultSortOrder:'descend',
            // sorter: (a, b) => {return a.startTime>b.startTime?1:-1}
          },
          {
            title: '结束时间',
            align: 'center',
            dataIndex: 'endTime',
            // defaultSortOrder:'descend',
            // sorter: (a, b) => {return a.endTime>b.endTime?1:-1}
          },
          {
            title: '持续时间',
            align: 'center',
            dataIndex: 'duration',
            // defaultSortOrder:'descend',
            // sorter: (a, b) => {return a.duration>b.duration?1:-1}
          },
          {
            title: '程序号',
            align: 'center',
            dataIndex: 'sequencenumber'
          }
        ]
      }
    },
    methods: {
      handleTableChange(pagination, filters, sorter) {
        //分页、排序、筛选变化时触发
        //TODO 筛选
        if (Object.keys(sorter).length > 0) {
          this.isorter.column = sorter.field;
          this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
        }
        this.ipagination = pagination;
        // this.loadData();
      },
    },
    created() {
    }
 
  }
</script>
 
<style lang="less" scoped>
  @import '~@assets/less/common.less';
  @media screen and (min-width: 1920px){
    .table_logList{
      height: 417px!important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1680px) and (max-width: 1920px){
    .table_logList{
      height: 417px!important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1400px) and (max-width: 1680px){
    .table_logList{
      height: 266px!important;
      overflow: scroll;
    }
  }
  @media screen and (min-width: 1280px) and (max-width: 1400px){
    .table_logList{
      height: 360px!important;
      overflow: scroll;
    }
  }
  @media screen and (max-width: 1280px){
    .table_logList{
      height: 170px!important;
      overflow: scroll;
    }
  }
</style>