ExecutorlogList.vue
3.92 KB
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
<template>
<a-card :bordered="false">
<!-- table区域-begin -->
<div>
<a-table
ref="table"
size="middle"
:scroll="{ x: false }"
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
class="j-table-force-nowrap"
@change="handleTableChange"
></a-table>
</div>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { httpGroupRequest } from '@/api/GroupRequest.js'
import { getAction, postAction } from '@/api/manage'
export default {
name: 'ScaninRecordList',
mixins: [JeecgListMixin, mixinDevice],
props: ['groupId'],
components: {},
data() {
let ellipsis1 = (v, l = 180) => <j-ellipsis value={v} length={l} />
return {
description: '上线扫码管理页面',
dataSource: [],
isorter: {
column: 'updateTime',
order: 'desc'
},
// 表头
columns: [
{
title: 'ID',
align: 'center',
dataIndex: 'id'
},
{
title: this.$t('system.content'),
align: 'center',
dataIndex: 'content',
customRender: t => ellipsis1(t)
},
{
title: this.$t('system.level'),
align: 'center',
dataIndex: 'level'
},
{
title: this.$t('system.createTime'),
align: 'center',
dataIndex: 'createTime'
},
{
title: this.$t('system.updateTime'),
align: 'center',
dataIndex: 'updateTime'
}
],
url: {
list: '/log/executorlog/list',
add: '/scan/scaninRecord/add'
},
dictOptions: {},
superFieldList: []
}
},
mounted() {
// 每隔3秒定时刷新
this.timer = setInterval(() => {
this.loadPeriodData()
}, 2000)
},
created() {
// this.$nextTick(() => this.$refs.input.focus())
this.getSuperFieldList()
},
computed: {
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
},
methods: {
// focus() {
// this.$nextTick(() => this.$refs.input.focus())
// },
add() {
let params = Object.assign({}, this.queryParam, this.isorter)
let url = `${this.url.add}`
//缓存key
let groupIdKey
if (this.groupId) {
groupIdKey = this.groupId + url
}
httpGroupRequest(() => postAction(url, params), groupIdKey).then(res => {
if (res.success) {
if (res.message != '') {
this.$notification.success({
message: this.$t('system.systemMessage'),
description: this.queryParam.context + ' ' + this.$t('scanin.scanSuccessful')
})
this.loadPeriodData()
}
} else {
this.$notification.error({
message: this.$t('system.systemMessage'),
description: res.message
})
}
this.searchReset()
})
},
initDictConfig() {},
getSuperFieldList() {
let fieldList = []
fieldList.push({ type: 'string', value: 'context', text: 'context', dictCode: '' })
fieldList.push({ type: 'string', value: 'status', text: 'status', dictCode: '' })
this.superFieldList = fieldList
},
async loadPeriodData() {
let params = Object.assign({}, null, this.isorter)
let url = `${this.url.list}`
//缓存key
let groupIdKey
if (this.groupId) {
groupIdKey = this.groupId + url
}
httpGroupRequest(() => getAction(url, params), groupIdKey).then(res => {
let data = res.result
if (data.length > 0) {
this.dataSource = data
} else {
this.dataSource = []
}
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>