groupName中文名++
This commit is contained in:
parent
e998d44266
commit
1d740bb143
@ -1,3 +1,5 @@
|
||||
import {$t} from "@/locales";
|
||||
|
||||
const local: App.I18n.Schema = {
|
||||
system: {
|
||||
title: 'Task Flux',
|
||||
@ -521,9 +523,9 @@ const local: App.I18n.Schema = {
|
||||
title: '在线机器',
|
||||
nodeType: '类型',
|
||||
groupName: '组名称',
|
||||
hostId: 'Pod ID',
|
||||
hostIp: 'IP',
|
||||
hostPort: 'Port',
|
||||
hostId: '机器 ID',
|
||||
hostIp: 'IP地址',
|
||||
hostPort: '端口',
|
||||
consumerBuckets: '路径/组',
|
||||
updateDt: '更新时间',
|
||||
contextPath: '路径/组',
|
||||
@ -538,7 +540,7 @@ const local: App.I18n.Schema = {
|
||||
namespace: {
|
||||
title: '命名空间',
|
||||
name: '名称',
|
||||
keyword: '空间名称/唯一标识',
|
||||
keyword: '名称/标识',
|
||||
uniqueId: '唯一标识(默认UUID)',
|
||||
form: {
|
||||
name: '请输入空间名称',
|
||||
@ -554,6 +556,7 @@ const local: App.I18n.Schema = {
|
||||
detail: '组详情',
|
||||
namespaceId: '命名空间ID',
|
||||
groupName: '组名称',
|
||||
groupNameCn: '中文组名称',
|
||||
token: 'Token',
|
||||
groupStatus: '状态',
|
||||
idGeneratorMode: 'ID生成模式',
|
||||
@ -567,6 +570,7 @@ const local: App.I18n.Schema = {
|
||||
retryConfig: '重试配置',
|
||||
form: {
|
||||
groupName: '请输入组名称',
|
||||
groupNameCn: '请输入中文组名称',
|
||||
token: 'Token',
|
||||
groupStatus: '状态',
|
||||
description: '描述',
|
||||
|
3
src/typings/api.d.ts
vendored
3
src/typings/api.d.ts
vendored
@ -389,6 +389,8 @@ declare namespace Api {
|
||||
namespaceName?: string;
|
||||
/** 组名 */
|
||||
groupName: string;
|
||||
/** 中文组名 */
|
||||
groupNameCn: string;
|
||||
/** 组描述 */
|
||||
description: string;
|
||||
/** token */
|
||||
@ -420,6 +422,7 @@ declare namespace Api {
|
||||
|
||||
type GroupConfigRequestVO = {
|
||||
groupName: string;
|
||||
groupNameCn: string;
|
||||
groupStatus: GroupStatusType;
|
||||
token?: string;
|
||||
description?: string;
|
||||
|
2
src/typings/app.d.ts
vendored
2
src/typings/app.d.ts
vendored
@ -776,6 +776,7 @@ declare namespace App {
|
||||
detail: string;
|
||||
namespaceId: string;
|
||||
groupName: string;
|
||||
groupNameCn: string;
|
||||
description: string;
|
||||
token: string;
|
||||
groupStatus: string;
|
||||
@ -789,6 +790,7 @@ declare namespace App {
|
||||
retryConfig: string;
|
||||
form: {
|
||||
groupName: string;
|
||||
groupNameCn: string;
|
||||
token: string;
|
||||
groupStatus: string;
|
||||
description: string;
|
||||
|
@ -55,6 +55,13 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'groupNameCn',
|
||||
title: $t('page.groupConfig.groupNameCn'),
|
||||
align: 'center',
|
||||
minWidth: 100,
|
||||
|
||||
},
|
||||
{
|
||||
key: 'groupStatus',
|
||||
title: $t('page.groupConfig.groupStatus'),
|
||||
|
@ -50,6 +50,9 @@ async function handleCopy(source?: string) {
|
||||
<NDescriptionsItem :label="$t('page.groupConfig.groupName')" :span="1">
|
||||
{{ rowData?.groupName }}
|
||||
</NDescriptionsItem>
|
||||
<NDescriptionsItem :label="$t('page.groupConfig.groupNameCn')" :span="1">
|
||||
{{ rowData?.groupNameCn }}
|
||||
</NDescriptionsItem>
|
||||
|
||||
<NDescriptionsItem :span="1">
|
||||
<template #label>
|
||||
|
@ -45,7 +45,7 @@ const partitionList = ref<string[]>([]);
|
||||
|
||||
type Model = Pick<
|
||||
Api.GroupConfig.GroupConfig,
|
||||
'id' | 'groupName' | 'token' | 'groupStatus' | 'description' | 'idGeneratorMode' | 'initScene' | 'groupPartition'
|
||||
'id' | 'groupName' | 'groupNameCn' | 'token' | 'groupStatus' | 'description' | 'idGeneratorMode' | 'initScene' | 'groupPartition'
|
||||
>;
|
||||
|
||||
const model: Model = reactive(createDefaultModel());
|
||||
@ -53,6 +53,7 @@ const model: Model = reactive(createDefaultModel());
|
||||
function createDefaultModel(): Model {
|
||||
return {
|
||||
groupName: '',
|
||||
groupNameCn: '',
|
||||
token: import.meta.env.VITE_APP_DEFAULT_TOKEN || '',
|
||||
groupStatus: 1,
|
||||
description: '',
|
||||
@ -64,7 +65,7 @@ function createDefaultModel(): Model {
|
||||
|
||||
type RuleKey = Extract<
|
||||
keyof Model,
|
||||
'groupName' | 'token' | 'groupStatus' | 'idGeneratorMode' | 'initScene' | 'groupPartition'
|
||||
'groupName' | 'groupNameCn' | 'token' | 'groupStatus' | 'idGeneratorMode' | 'initScene' | 'groupPartition'
|
||||
>;
|
||||
|
||||
const rules = {
|
||||
@ -76,6 +77,8 @@ const rules = {
|
||||
message: $t('page.groupConfig.form.groupNameRule')
|
||||
}
|
||||
],
|
||||
groupNameCn: [defaultRequiredRule],
|
||||
|
||||
token: [defaultRequiredRule],
|
||||
groupStatus: [defaultRequiredRule],
|
||||
idGeneratorMode: [defaultRequiredRule],
|
||||
@ -102,9 +105,10 @@ async function handleSubmit() {
|
||||
await validate();
|
||||
// request
|
||||
if (props.operateType === 'add') {
|
||||
const { groupName, token, groupStatus, description, idGeneratorMode, initScene, groupPartition } = model;
|
||||
const { groupName, groupNameCn, token, groupStatus, description, idGeneratorMode, initScene, groupPartition } = model;
|
||||
const { error } = await fetchAddGroupConfig({
|
||||
groupName,
|
||||
groupNameCn,
|
||||
token,
|
||||
groupStatus,
|
||||
description,
|
||||
@ -115,9 +119,11 @@ async function handleSubmit() {
|
||||
if (error) return;
|
||||
window.$message?.success($t('common.addSuccess'));
|
||||
} else {
|
||||
const { groupName, token, groupStatus, description, idGeneratorMode, initScene, groupPartition } = model;
|
||||
|
||||
const { groupName, groupNameCn, token, groupStatus, description, idGeneratorMode, initScene, groupPartition } = model;
|
||||
const { error } = await fetchEditGroupConfig({
|
||||
groupName,
|
||||
groupNameCn,
|
||||
token,
|
||||
groupStatus,
|
||||
description,
|
||||
@ -200,6 +206,15 @@ async function handleCopy(source: string) {
|
||||
:disabled="props.operateType === 'edit'"
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem :label="$t('page.groupConfig.groupNameCn')" path="groupNameCn">
|
||||
<NInput
|
||||
v-model:value="model.groupNameCn"
|
||||
:maxlength="64"
|
||||
show-count
|
||||
:placeholder="$t('page.groupConfig.form.groupNameCn')"
|
||||
:disabled="props.operateType === 'edit'"
|
||||
/>
|
||||
</NFormItem>
|
||||
<NFormItem :label="$t('page.groupConfig.groupStatus')" path="groupStatus">
|
||||
<NRadioGroup v-model:value="model.groupStatus" name="groupStatus">
|
||||
<NSpace>
|
||||
|
Loading…
Reference in New Issue
Block a user