fix:修改所有关于表格的时间显示问题

This commit is contained in:
zhangyu
2021-05-10 13:49:27 +08:00
parent 03657068ab
commit f56ca0fac5
9 changed files with 26 additions and 23 deletions

View File

@@ -10,7 +10,7 @@
<!-- end--顶部按钮-->
<!-- begin--标题-->
<div class="right-box-title">{{editAlertRule.id ? $t("alert.config.editAlertConfig") + " ID" + editAlertRule.id : $t("alert.config.createAlertConfig")}}</div>
<div class="right-box-title">{{editAlertRule.id ? $t("alert.config.editAlertConfig") : $t("alert.config.createAlertConfig")}}</div>
<!-- end--标题-->
<!-- begin--表单-->

View File

@@ -129,7 +129,7 @@ export default {
components: {
nzAlertTag,
alertRuleInfo: alertRuleInfo,
alertLabel: alertLabel,
alertLabel: alertLabel
},
props: {
nowTime: {
@@ -157,27 +157,26 @@ export default {
prop: 'id',
show: true,
width: 80,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('alert.alertName'),
prop: 'alertRule',
show: true,
width: 180,
sortable:false,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('alert.list.labels'),
prop: 'labels',
show: true,
NotSet: true,
minWidth: 250,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('alert.severity'),
prop: 'severity',
show: true,
width: 110,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('alert.summary'),
prop: 'summary',
@@ -193,18 +192,18 @@ export default {
prop: 'remark',
show: false,
minWidth: 200
}, {
}, {
label: this.$t('alert.startAt'),
prop: 'startAt',
show: true,
width: 150,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('config.terminallog.duration'),
prop: 'duration',
show: true,
width: 150
},
}
],
viewAssetState: false,
tableDataInitNum: 0
@@ -260,9 +259,9 @@ export default {
})
return result
},
chartUnitChange:function(unit){
this.chartUnit=unit;
this.$nextTick(()=>{
chartUnitChange: function (unit) {
this.chartUnit = unit
this.$nextTick(() => {
this.queryChartDate()
})
},
@@ -411,8 +410,8 @@ export default {
this.queryChartDate()
})
},
dialogClose() {
this.graphShow = false;
dialogClose () {
this.graphShow = false
},
getAlertList () {
if (!this.scrollbarWrap) {

View File

@@ -168,7 +168,7 @@ export default {
if (record.endAt) {
return calcDurationByStringTimeB(record.startAt, record.endAt)
}
return calcDurationByStringTimeB(record.startAt, this.nowTime)
return calcDurationByStringTimeB(record.startAt, this.utcTimeToTimezoneStr(this.nowTime))
}
},
tagType () {

View File

@@ -38,7 +38,7 @@
{{scope.row[item.prop]}} ms
</span>
<span v-else-if="item.prop === 'username'">{{formatUsername(scope.row)}}</span>
<span v-else-if="item.prop === 'createDate'">{{scope.row[item.prop]}}</span>
<span v-else-if="item.prop === 'createDate'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<span v-else>{{scope.row[item.prop]}}</span>
</template>
</el-table-column>

View File

@@ -43,11 +43,14 @@
<template v-else-if="item.prop === 'remote'">
<span>{{getRemoteText(scope.row)}}</span>
</template>
<template v-else-if="item.prop === 'startTime'">
<span> {{utcTimeToTimezoneStr(scope.row.startTime)}}</span>
</template>
<template v-else-if="item.prop === 'duration'">
<el-tooltip :disabled="!scope.row.status" effect="light" placement="right">
<div slot="content">
{{$t('config.terminallog.endTime')}}<br/>
{{scope.row.endTime}}
{{utcTimeToTimezoneStr(scope.row.endTime)}}
</div>
<span>{{getDuration(scope.row)}}</span>
</el-tooltip>

View File

@@ -52,6 +52,7 @@
</el-switch>
</template>
<span v-else-if="item.prop === 'createTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<span v-else-if="item.prop === 'lastLoginTime'">{{utcTimeToTimezoneStr(scope.row[item.prop])}}</span>
<span v-else>{{scope.row[item.prop]}}</span>
</template>
</el-table-column>
@@ -89,13 +90,13 @@ export default {
prop: 'id',
show: true,
width: 80,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('config.user.name'),
prop: 'name',
show: true,
width: 150,
sortable:'custom'
sortable: 'custom'
}, {
label: this.$t('config.user.username'),
prop: 'username',

View File

@@ -109,7 +109,7 @@
<div v-loading="topologyLoading" class="content-col-content">
<transition name = "el-zoom-in-center">
<div v-if="allProject&&allProject.length>0" style="width: 100%;height: 100%;position: relative">
<el-carousel :interval="5000" :autoplay="false" :trigger="'click'" arrow="hover">
<el-carousel :interval="5000" :trigger="'click'" arrow="hover">
<el-carousel-item v-for="(item,index) in allProject" :key="index">
<div class="maskLayer" @click="toProject(item)"></div>
<span class="project-name">{{item.name}}</span>

View File

@@ -127,7 +127,7 @@
<div class="content-col-content" v-loading="topologyLoading">
<transition name = "el-zoom-in-center">
<div style="width: 100%;height: 100%;position: relative" v-if="allProject&&allProject.length>0">
<el-carousel :interval="50000" :autoplay="false" arrow="hover" :trigger="'click'">
<el-carousel :interval="5000" arrow="hover" :trigger="'click'">
<el-carousel-item v-for="(item,index) in allProject" :key="index">
<div class="maskLayer" @click="toProject(item)"></div>
<span class="project-name">{{item.name}}</span>

View File

@@ -338,7 +338,7 @@ export default new Vue({
} else {
return configTime
}
}
},
},
created () {
this.getDefaultDate()