perf: update some i18n

This commit is contained in:
ibuler
2025-02-13 16:41:06 +08:00
parent 0cd9f6dcd6
commit f1956b4982
4 changed files with 5 additions and 112 deletions

View File

@@ -109,7 +109,8 @@ export default {
font-size: 12px;
line-height: 1.5;
font-weight: 400;
width: 120px;
width: 33%;
min-width: 120px;
padding: 5px 0;
span {

View File

@@ -1,108 +0,0 @@
<template>
<el-date-picker
v-model="value"
:clearable="false"
:default-time="['00:00:01', '23:59:59']"
:end-placeholder="$tc('DateEnd')"
:picker-options="pickerOptions"
:range-separator="$tc('To')"
:start-placeholder="$tc('DateStart')"
class="datepicker"
size="small"
type="datetimerange"
v-bind="$attrs"
@change="handleDateChange"
v-on="$listeners"
/>
</template>
<script>
export default {
name: 'DatetimeRangePicker',
components: {},
props: {
dateStart: {
type: [Number, String, Date],
default: null
},
dateEnd: {
type: [Number, String, Date],
default: null
}
},
data() {
const startValue = this.dateStart || this.$route.query['date_start']
const endValue = this.dateEnd || this.$route.query['date_end']
const dateStart = new Date(startValue)
const dateTo = new Date(endValue)
return {
value: [dateStart, dateTo],
pickerOptions: {
shortcuts: [
{
text: this.$t('DateLast24Hours'),
onClick: (picker) => this.onShortcutClick(picker, 1)
},
{
text: this.$t('DateLastWeek'),
onClick: (picker) => this.onShortcutClick(picker, 7)
}, {
text: this.$t('DateLastMonth'),
onClick: (picker) => this.onShortcutClick(picker, 30)
}, {
text: this.$t('DateLast3Months'),
onClick: (picker) => this.onShortcutClick(picker, 90)
}, {
text: this.$t('DateLastHarfYear'),
onClick: (picker) => this.onShortcutClick(picker, 183)
}, {
text: this.$t('DateLastYear'),
onClick: (picker) => this.onShortcutClick(picker, 365)
}
]
}
}
},
mounted() {
this.$log.debug('Datetime range picker value: ', this.value)
},
methods: {
handleDateChange(val) {
if (val[0].getTime() && val[1].getTime()) {
this.$log.debug('Date change: ', val)
this.$emit('dateChange', val)
}
},
onShortcutClick(picker, day) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * day)
picker.$emit('pick', [start, end])
}
}
}
</script>
<style lang='scss' scoped>
.datepicker {
margin-left: 10px;
width: 233px;
border: 1px solid #dcdee2;
border-radius: 2px;
height: 28px;
::v-deep .el-range-separator,
::v-deep .el-input__icon {
line-height: 26px;
color: var(--color-icon-primary) !important;
}
::v-deep .el-range-input {
color: var(--color-text-primary) !important;
}
::v-deep .el-range-input {
width: 49%;
}
}
</style>

View File

@@ -5,10 +5,10 @@
:default-time="['00:00:01', '23:59:59']"
:end-placeholder="$tc('DateEnd')"
:picker-options="pickerOptions"
:range-separator="$tc('To')"
:start-placeholder="$tc('DateStart')"
:type="type"
class="datepicker"
range-separator="-"
size="small"
v-bind="$attrs"
@change="handleDateChange"

View File

@@ -20,7 +20,7 @@ export default [
component: () => import('@/views/sessions/SessionList/index.vue'),
name: 'AccountSessionList',
meta: {
title: i18n.t('SessionList'),
title: i18n.t('AccountSessions'),
permissions: []
}
}
@@ -45,7 +45,7 @@ export default [
component: () => import('@/views/accounts/AccountActivity/AccountActivityList.vue'),
name: 'AccountActivityList',
meta: {
title: i18n.t('Activity'),
title: i18n.t('AccountActivities'),
permissions: ['audits.view_operatelog']
}
}