提交 | 用户 | 时间
|
850106
|
1 |
<template> |
H |
2 |
<el-drawer |
|
3 |
direction="rtl" |
|
4 |
:visible.sync="visible" |
|
5 |
@close="handleClose" |
|
6 |
size="50%"> |
|
7 |
<div class="mod-app-menu" style="padding: 5px;"> |
|
8 |
<el-form :inline="true" :model="dataForm" ref="dataForm"> |
|
9 |
<el-form-item> |
|
10 |
<el-date-picker |
|
11 |
v-model="dataForm.startTime" |
|
12 |
type="datetime" |
|
13 |
placeholder="选择开始时间" |
|
14 |
value-format="yyyy-MM-dd HH:mm:ss" |
|
15 |
> |
|
16 |
</el-date-picker> |
|
17 |
</el-form-item> |
|
18 |
<el-form-item> |
|
19 |
<el-date-picker |
|
20 |
v-model="dataForm.endTime" |
|
21 |
type="datetime" |
|
22 |
placeholder="选择结束时间" |
|
23 |
value-format="yyyy-MM-dd HH:mm:ss" |
|
24 |
> |
|
25 |
</el-date-picker> |
|
26 |
</el-form-item> |
|
27 |
<el-form-item> |
|
28 |
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|
29 |
</el-form-item> |
|
30 |
</el-form> |
|
31 |
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;" |
|
32 |
@selection-change="dataListSelectionChangeHandle"> |
|
33 |
<el-table-column type="index" header-align="center" align="center" width="50"></el-table-column> |
|
34 |
<el-table-column prop="reportNo" :label="$t('healthReport.reportNo')" header-align="center" |
|
35 |
min-width="150"></el-table-column> |
|
36 |
<el-table-column prop="healthLevel" :label="$t('healthReport.healthLevel')" header-align="center" align="center" |
|
37 |
min-width="100"> |
|
38 |
<template slot-scope="scope"> |
|
39 |
<el-tag v-if="scope.row.healthLevel === '1'" size="small" type="success">健康</el-tag> |
|
40 |
<el-tag v-if="scope.row.healthLevel === '2'" size="small" type="warning">良好</el-tag> |
|
41 |
<el-tag v-if="scope.row.healthLevel === '3'" size="small" type="danger">不良</el-tag> |
|
42 |
</template> |
|
43 |
</el-table-column> |
|
44 |
<el-table-column prop="healthScore" :label="$t('healthReport.healthScore')" header-align="center" align="center" |
|
45 |
min-width="100"></el-table-column> |
|
46 |
<el-table-column prop="abnormalCount" :label="$t('healthReport.abnormalCount')" header-align="center" align="center" |
|
47 |
min-width="100"></el-table-column> |
|
48 |
<el-table-column prop="reportDate" :label="$t('healthReport.reportDate')" header-align="center" align="center" |
|
49 |
min-width="150"></el-table-column> |
|
50 |
<el-table-column :label="$t('handle')" header-align="center" align="center" width="100"> |
|
51 |
<template slot-scope="scope"> |
|
52 |
<el-button type="text" size="small" |
|
53 |
@click="viewHandle(scope.row.id)">{{ $t('view') }} |
|
54 |
</el-button> |
|
55 |
</template> |
|
56 |
</el-table-column> |
|
57 |
</el-table> |
|
58 |
<!-- 弹窗, 报表详情 --> |
|
59 |
<report-view v-if="reportViewVisible" ref="reportView"></report-view> |
|
60 |
</div> |
|
61 |
</el-drawer> |
|
62 |
</template> |
|
63 |
<script> |
|
64 |
import mixinViewModule from '@/mixins/view-module' |
|
65 |
import ReportView from './health-report-view' |
|
66 |
|
|
67 |
export default { |
|
68 |
mixins: [mixinViewModule], |
|
69 |
data() { |
|
70 |
return { |
|
71 |
mixinViewModuleOptions: { |
|
72 |
createdIsNeed: false, |
|
73 |
getDataListURL: '/iailab-ntt-model/device/health-report/page', |
|
74 |
getDataListIsPage: true, |
|
75 |
deleteURL: '/iailab-ntt-model/device/health-report', |
|
76 |
deleteIsBatch: true |
|
77 |
}, |
|
78 |
visible: false, |
|
79 |
dataForm: { |
|
80 |
devNo: '0', |
|
81 |
reportNo: '', |
|
82 |
startTime: "", |
|
83 |
endTime: "", |
|
84 |
}, |
|
85 |
reportViewVisible: false |
|
86 |
} |
|
87 |
}, |
|
88 |
components: { |
|
89 |
ReportView |
|
90 |
}, |
|
91 |
methods: { |
|
92 |
init(devNo) { |
|
93 |
this.dataForm.devNo = devNo |
|
94 |
this.visible = true |
|
95 |
this.$nextTick(() => { |
|
96 |
this.getDataList() |
|
97 |
}) |
|
98 |
}, |
|
99 |
|
|
100 |
viewHandle(id) { |
|
101 |
this.reportViewVisible = true |
|
102 |
this.$nextTick(() => { |
|
103 |
this.$refs.reportView.dataForm.id = id |
|
104 |
this.$refs.reportView.init() |
|
105 |
}) |
|
106 |
|
|
107 |
}, |
|
108 |
|
|
109 |
handleClose() { |
|
110 |
this.$refs['dataForm'].resetFields() |
|
111 |
this.dataList = [] |
|
112 |
}, |
|
113 |
} |
|
114 |
|
|
115 |
} |
|
116 |
</script> |