feat:告警界面中英文
This commit is contained in:
@@ -12,5 +12,18 @@
|
|||||||
"descriptionPlaceholder": "Please enter description",
|
"descriptionPlaceholder": "Please enter description",
|
||||||
"createTime": "Create Time",
|
"createTime": "Create Time",
|
||||||
"updateTime": "Update Time",
|
"updateTime": "Update Time",
|
||||||
"operation": "Operation"
|
"operation": "Operation",
|
||||||
|
"day": "day",
|
||||||
|
"Reminder": "Reminder",
|
||||||
|
"selectremind": "Please select the person to be reminded.",
|
||||||
|
"reminderdays": "Reminder days",
|
||||||
|
"selectday": "Please select the number of days to be reminded",
|
||||||
|
"content": "Content",
|
||||||
|
"selectcontent": "Please enter the reminder content",
|
||||||
|
"status": "Status",
|
||||||
|
"enable": "enable",
|
||||||
|
"disable": "disable",
|
||||||
|
"alerttitle": "Alarm configuration",
|
||||||
|
"save": "Save",
|
||||||
|
"reset": "Reset"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,5 +84,6 @@
|
|||||||
},
|
},
|
||||||
"customer": "Customer Management",
|
"customer": "Customer Management",
|
||||||
"project": "Project Management",
|
"project": "Project Management",
|
||||||
"license": "License Management"
|
"license": "License Management",
|
||||||
|
"alert": "Alarm Management"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,5 +12,18 @@
|
|||||||
"descriptionPlaceholder": "请输入描述信息",
|
"descriptionPlaceholder": "请输入描述信息",
|
||||||
"createTime": "创建时间",
|
"createTime": "创建时间",
|
||||||
"updateTime": "更新时间",
|
"updateTime": "更新时间",
|
||||||
"operation": "操作"
|
"operation": "操作",
|
||||||
|
"day": "天",
|
||||||
|
"Reminder": "提醒人",
|
||||||
|
"selectremind": "请选择提醒人",
|
||||||
|
"reminderdays": "提醒天数",
|
||||||
|
"selectday": "请选择提醒天数",
|
||||||
|
"content": "提醒内容",
|
||||||
|
"selectcontent": "请输入提醒内容",
|
||||||
|
"status": "启用状态",
|
||||||
|
"enable": "启用",
|
||||||
|
"disable": "禁用",
|
||||||
|
"alerttitle": "告警配置",
|
||||||
|
"save": "保存",
|
||||||
|
"reset": "重置"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,5 +84,6 @@
|
|||||||
},
|
},
|
||||||
"customer": "客户管理",
|
"customer": "客户管理",
|
||||||
"project": "项目管理",
|
"project": "项目管理",
|
||||||
"license": "License管理"
|
"license": "License管理",
|
||||||
|
"alert": "告警管理"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { Button, Card, message, Space } from 'ant-design-vue';
|
|||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { getAlertPage, updateAlert } from '#/api/alert/alert';
|
import { getAlertPage, updateAlert } from '#/api/alert/alert';
|
||||||
import { getUserPage } from '#/api/system/user';
|
import { getUserPage } from '#/api/system/user';
|
||||||
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
@@ -22,10 +23,10 @@ const userOptions = ref([]);
|
|||||||
|
|
||||||
// 提醒天数选项
|
// 提醒天数选项
|
||||||
const daysOptions = [
|
const daysOptions = [
|
||||||
{ label: '15天', value: 15 },
|
{ label: '15'+$t('alert.day'), value: 15 },
|
||||||
{ label: '7天', value: 7 },
|
{ label: '7'+$t('alert.day'), value: 7 },
|
||||||
{ label: '2天', value: 2 },
|
{ label: '2'+$t('alert.day'), value: 2 },
|
||||||
{ label: '1天', value: 1 },
|
{ label: '1'+$t('alert.day'), value: 1 },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 表单配置
|
// 表单配置
|
||||||
@@ -40,11 +41,11 @@ const formSchema = computed(() => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'users',
|
fieldName: 'users',
|
||||||
label: '提醒人',
|
label: $t('alert.Reminder'),
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择提醒人',
|
placeholder: $t('alert.selectremind'),
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
@@ -56,11 +57,11 @@ const formSchema = computed(() => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'days',
|
fieldName: 'days',
|
||||||
label: '提醒天数',
|
label: $t('alert.reminderdays'),
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请选择提醒天数',
|
placeholder: $t('alert.selectday'),
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
options: daysOptions,
|
options: daysOptions,
|
||||||
@@ -68,11 +69,11 @@ const formSchema = computed(() => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'content',
|
fieldName: 'content',
|
||||||
label: '提醒内容',
|
label: $t('alert.content'),
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
component: 'Textarea',
|
component: 'Textarea',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
placeholder: '请输入提醒内容',
|
placeholder: $t('alert.selectcontent'),
|
||||||
rows: 4,
|
rows: 4,
|
||||||
showCount: true,
|
showCount: true,
|
||||||
maxlength: 500,
|
maxlength: 500,
|
||||||
@@ -80,11 +81,11 @@ const formSchema = computed(() => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'status',
|
fieldName: 'status',
|
||||||
label: '启用状态',
|
label: $t('alert.status'),
|
||||||
component: 'Switch',
|
component: 'Switch',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
checkedChildren: '启用',
|
checkedChildren: $t('alert.enable'),
|
||||||
unCheckedChildren: '禁用',
|
unCheckedChildren: $t('alert.disable'),
|
||||||
checkedValue: 1,
|
checkedValue: 1,
|
||||||
unCheckedValue: 2,
|
unCheckedValue: 2,
|
||||||
style: { width: 'auto' },
|
style: { width: 'auto' },
|
||||||
@@ -125,7 +126,6 @@ async function handleSubmit() {
|
|||||||
// 根据实际需要调用创建或更新接口
|
// 根据实际需要调用创建或更新接口
|
||||||
if (values.id) {
|
if (values.id) {
|
||||||
await updateAlert(submitData);
|
await updateAlert(submitData);
|
||||||
message.success('更新成功');
|
|
||||||
}
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
@@ -178,12 +178,12 @@ onMounted(async () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<Card title="告警配置">
|
<Card :title="$t('alert.alerttitle')">
|
||||||
<Form />
|
<Form />
|
||||||
<div class="mt-4 flex justify-end">
|
<div class="mt-4 flex justify-end">
|
||||||
<Space>
|
<Space>
|
||||||
<Button type="primary" @click="handleSubmit">保存</Button>
|
<Button type="primary" @click="handleSubmit">{{$t('alert.save')}}</Button>
|
||||||
<Button @click="handleReset">重置</Button>
|
<Button @click="handleReset">{{ $t('alert.reset') }}</Button>
|
||||||
</Space>
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user