Commit 8aff47fb authored by Asjoker's avatar Asjoker

feat: 最终修改

parent ac68c7a4
......@@ -18,12 +18,25 @@
:data="tableData1"
border
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="monPoint" show-overflow-tooltip />
<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="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>
</div>
<el-dialog class="customClass" width="50%" title="查询时间" :visible.sync="customDialog" @close="closeCustomDialog">
......@@ -81,7 +94,7 @@ export default {
devName: '测试设备1',
monPoint: '1号监测点',
times: '2',
duration: '133',
duration: '133小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -89,7 +102,7 @@ export default {
devName: '测试设备2',
monPoint: '',
times: '3',
duration: '32',
duration: '32小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -97,7 +110,7 @@ export default {
devName: '测试设备3',
monPoint: '',
times: '1',
duration: '156天',
duration: '11小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -105,7 +118,7 @@ export default {
devName: '测试设备4',
monPoint: '',
times: '2',
duration: '7',
duration: '7小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -113,7 +126,7 @@ export default {
devName: '测试设备5',
monPoint: '2号监测点',
times: '2',
duration: '56天',
duration: '16小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -121,7 +134,7 @@ export default {
devName: '测试设备6',
monPoint: '',
times: '2',
duration: '56天',
duration: '19小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -129,7 +142,7 @@ export default {
devName: '测试设备7',
monPoint: '1号监测点',
times: '5',
duration: '55',
duration: '55小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -137,7 +150,7 @@ export default {
devName: '测试设备1',
monPoint: '',
times: '6',
duration: '146',
duration: '146小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -145,7 +158,7 @@ export default {
devName: '测试设备4',
monPoint: '3号监测点',
times: '4',
duration: '676天',
duration: '67小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
},
{
......@@ -153,7 +166,7 @@ export default {
devName: '测试设备7',
monPoint: '6号监测点',
times: '9',
duration: '345天',
duration: '34小时',
startTime: moment(Date()).format('YYYY-MM-DD HH:mm')
}
],
......@@ -220,6 +233,18 @@ export default {
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) {},
exportWarning() {
this.$confirm('是否导出数据', '提示', {
......@@ -238,6 +263,13 @@ export default {
<style lang="scss">
.warnModule {
.st-square{
cursor: pointer;
margin-right: 6px;
width: 9px;
height: 9px;
display: inline-block;
}
.strategyRow {
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