Commit 8aff47fb authored by Asjoker's avatar Asjoker

feat: 最终修改

parent ac68c7a4
...@@ -18,12 +18,25 @@ ...@@ -18,12 +18,25 @@
:data="tableData1" :data="tableData1"
border border
style="width: 100%;padding-top: 20px"> style="width: 100%;padding-top: 20px">
<el-table-column label="级别" prop="level" show-overflow-tooltip /> <el-table-column label="级别" prop="level" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.level === '2级(危险)'" class="st-square" style="background-color: #eb5d5d;" />
<span v-if="scope.row.level === '1级'" class="st-square" style="background-color: #edb845;" />
{{ scope.row.level }}
</template>
</el-table-column>
<el-table-column label="设备名称" prop="devName" show-overflow-tooltip /> <el-table-column label="设备名称" prop="devName" show-overflow-tooltip />
<el-table-column label="监测点" prop="monPoint" show-overflow-tooltip /> <el-table-column label="监测点" prop="monPoint" show-overflow-tooltip />
<el-table-column label="次数" prop="times" show-overflow-tooltip width="90" /> <el-table-column label="次数" prop="times" show-overflow-tooltip width="90" />
<el-table-column label="开始时间" prop="startTime" show-overflow-tooltip /> <el-table-column label="开始时间" prop="startTime" show-overflow-tooltip />
<el-table-column label="持续时间" prop="duration" show-overflow-tooltip /> <el-table-column label="持续时间" prop="duration" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="judgeTime(scope.row.duration) === '2'" class="st-square" style="background-color: #eb5d5d;" />
<span v-if="judgeTime(scope.row.duration) === '1'" class="st-square" style="background-color: #edb845;" />
<span v-if="judgeTime(scope.row.duration) === '3'" class="st-square" style="background-color: black;" />
{{ scope.row.duration }}
</template>
</el-table-column>
</el-table> </el-table>
</div> </div>
<el-dialog class="customClass" width="50%" title="查询时间" :visible.sync="customDialog" @close="closeCustomDialog"> <el-dialog class="customClass" width="50%" title="查询时间" :visible.sync="customDialog" @close="closeCustomDialog">
...@@ -81,7 +94,7 @@ export default { ...@@ -81,7 +94,7 @@ export default {
devName: '测试设备1', devName: '测试设备1',
monPoint: '1号监测点', monPoint: '1号监测点',
times: '2', times: '2',
duration: '133', duration: '133小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -89,7 +102,7 @@ export default { ...@@ -89,7 +102,7 @@ export default {
devName: '测试设备2', devName: '测试设备2',
monPoint: '', monPoint: '',
times: '3', times: '3',
duration: '32', duration: '32小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -97,7 +110,7 @@ export default { ...@@ -97,7 +110,7 @@ export default {
devName: '测试设备3', devName: '测试设备3',
monPoint: '', monPoint: '',
times: '1', times: '1',
duration: '156天', duration: '11小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -105,7 +118,7 @@ export default { ...@@ -105,7 +118,7 @@ export default {
devName: '测试设备4', devName: '测试设备4',
monPoint: '', monPoint: '',
times: '2', times: '2',
duration: '7', duration: '7小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -113,7 +126,7 @@ export default { ...@@ -113,7 +126,7 @@ export default {
devName: '测试设备5', devName: '测试设备5',
monPoint: '2号监测点', monPoint: '2号监测点',
times: '2', times: '2',
duration: '56天', duration: '16小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -121,7 +134,7 @@ export default { ...@@ -121,7 +134,7 @@ export default {
devName: '测试设备6', devName: '测试设备6',
monPoint: '', monPoint: '',
times: '2', times: '2',
duration: '56天', duration: '19小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -129,7 +142,7 @@ export default { ...@@ -129,7 +142,7 @@ export default {
devName: '测试设备7', devName: '测试设备7',
monPoint: '1号监测点', monPoint: '1号监测点',
times: '5', times: '5',
duration: '55', duration: '55小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -137,7 +150,7 @@ export default { ...@@ -137,7 +150,7 @@ export default {
devName: '测试设备1', devName: '测试设备1',
monPoint: '', monPoint: '',
times: '6', times: '6',
duration: '146', duration: '146小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -145,7 +158,7 @@ export default { ...@@ -145,7 +158,7 @@ export default {
devName: '测试设备4', devName: '测试设备4',
monPoint: '3号监测点', monPoint: '3号监测点',
times: '4', times: '4',
duration: '676天', duration: '67小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}, },
{ {
...@@ -153,7 +166,7 @@ export default { ...@@ -153,7 +166,7 @@ export default {
devName: '测试设备7', devName: '测试设备7',
monPoint: '6号监测点', monPoint: '6号监测点',
times: '9', times: '9',
duration: '345天', duration: '34小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm') startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
} }
], ],
...@@ -220,6 +233,18 @@ export default { ...@@ -220,6 +233,18 @@ export default {
this.customDialog = true this.customDialog = true
} }
}, },
judgeTime(duration) {
const time = duration
var result = parseInt(time.replace('小时', ''))
console.log(result, 'result')
if (result < 12) {
return '1'
} else if (result >= 12 && result < 24) {
return '2'
} else if (result >= 24) {
return '3'
}
},
changeTime(row, column) {}, changeTime(row, column) {},
exportWarning() { exportWarning() {
this.$confirm('是否导出数据', '提示', { this.$confirm('是否导出数据', '提示', {
...@@ -238,6 +263,13 @@ export default { ...@@ -238,6 +263,13 @@ export default {
<style lang="scss"> <style lang="scss">
.warnModule { .warnModule {
.st-square{
cursor: pointer;
margin-right: 6px;
width: 9px;
height: 9px;
display: inline-block;
}
.strategyRow { .strategyRow {
padding: 5px 0; padding: 5px 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment