diff --git a/src/App.vue b/src/App.vue index e617af50..dba4d064 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 05532529..8e3eb7f6 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -379,6 +379,82 @@ const local: App.I18n.Schema = { triggerAllRequest: 'Manually Trigger All Automated Requests' } }, + proNaive: { + form: { + basic: { + title: 'Basic Example', + appName: 'ApplicationName', + appStatus: 'ApplicationStatus', + createTime: 'CreateTime', + responseDate: 'ResponseDate', + specificationInfo: 'SpecificationInfo', + specificate: 'Specificate', + specificationName: 'SpecificationName', + specificationValue: 'SpecificationValue', + specificationColorRed: 'Red', + specificationColorOrange: 'Orange', + addSpecificateItem: 'Add Specificate Item', + fillValue: 'FillValue', + reset: 'Reset', + submit: 'Submit', + add: 'Add', + delete: 'Delete', + color: 'Color', + normal: 'Normal', + anomaly: 'Anomaly' + }, + query: { + title1: 'Query Example, which expands by default', + title2: 'Query Example, which fold by default, and two lines are retained when folding', + appName: 'ApplicationName', + appStatus: 'ApplicationStatus', + createTime: 'CreateTime', + responseDate: 'ResponseDate', + endDate: 'EndDate', + field: 'Field' + }, + step: { + title: 'Step Form', + step1: { + title: 'Form 1', + field: 'Form 1 field', + nextStep: 'Next Step' + }, + step2: { + title: 'Form 2', + field: 'Form 2 field', + prevStep: 'Prev Step', + submit: 'Submit' + } + } + }, + table: { + remote: { + filterCondition: 'Filter Condition', + name: 'Name', + createTime: 'CreateTime', + responseTime: 'ResponseTime', + title: 'Remote Loading', + replicableText: 'Replicable Text', + tags: 'Tags', + dateFormatting: 'Date Formatting', + image: 'Image' + }, + rowEdit: { + title: 'Edit Table', + reset: 'Reset', + submit: 'Submit', + edit: 'Edit', + delete: 'Delete', + save: 'Save', + task: 'Task', + score: 'Score', + time: 'Time', + name: 'Name', + action: 'Action' + } + } + }, manage: { common: { status: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 3be07d1c..318c88e2 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -379,6 +379,82 @@ const local: App.I18n.Schema = { triggerAllRequest: '手动触发所有自动请求' } }, + proNaive: { + form: { + basic: { + title: '基础示例', + appName: '应用名称', + appStatus: '应用状态', + createTime: '创建时间', + responseDate: '响应日期', + specificationInfo: '规格信息', + specificate: '规格', + specificationName: '规格名', + specificationValue: '规格值', + specificationColorRed: '红', + specificationColorOrange: '橙', + addSpecificateItem: '添加规格项', + fillValue: '填充值', + reset: '重置', + submit: '提交', + add: '新建', + delete: '删除', + color: '颜色', + normal: '正常', + anomaly: '异常' + }, + query: { + title1: '查询表单,默认展开', + title2: '查询表单,默认折叠,折叠时保留2行', + appName: '应用名称', + appStatus: '应用状态', + createTime: '创建时间', + responseDate: '响应日期', + endDate: '结束日期', + field: '字段' + }, + step: { + title: '分步表单', + step1: { + title: '表单1', + field: '表单1字段', + nextStep: '下一步' + }, + step2: { + title: '表单2', + field: '表单2字段', + prevStep: '上一步', + submit: '提交' + } + } + }, + table: { + remote: { + filterCondition: '筛选条件', + name: '名称', + createTime: '创建时间', + responseTime: '响应时间', + title: '远程加载', + replicableText: '可复制文本', + tags: 'tags', + dateFormatting: '日期格式化', + image: '图片' + }, + rowEdit: { + title: '编辑表格', + reset: '重置', + submit: '提交', + edit: '编辑', + delete: '删除', + save: '保存', + task: '任务', + score: '评分', + time: '时间', + name: '名称', + action: '操作' + } + } + }, manage: { common: { status: { diff --git a/src/locales/naive.ts b/src/locales/naive.ts index fa187766..a4a28e4c 100644 --- a/src/locales/naive.ts +++ b/src/locales/naive.ts @@ -1,5 +1,6 @@ -import { dateEnUS, dateZhCN, enUS, zhCN } from 'naive-ui'; +import { dateEnUS, dateZhCN, enUS } from 'naive-ui'; import type { NDateLocale, NLocale } from 'naive-ui'; +import { zhCN } from 'pro-naive-ui'; export const naiveLocales: Record = { 'zh-CN': zhCN, diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index cc882d86..13603b97 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -554,6 +554,82 @@ declare namespace App { triggerAllRequest: string; }; }; + proNaive: { + form: { + basic: { + title: string; + appName: string; + appStatus: string; + createTime: string; + responseDate: string; + specificationInfo: string; + specificate: string; + specificationName: string; + specificationValue: string; + specificationColorRed: string; + specificationColorOrange: string; + addSpecificateItem: string; + fillValue: string; + reset: string; + submit: string; + add: string; + delete: string; + color: string; + normal: string; + anomaly: string; + }; + query: { + title1: string; + title2: string; + appName: string; + appStatus: string; + createTime: string; + responseDate: string; + endDate: string; + field: string; + }; + step: { + title: string; + step1: { + title: string; + field: string; + nextStep: string; + }; + step2: { + title: string; + field: string; + prevStep: string; + submit: string; + }; + }; + }; + table: { + remote: { + filterCondition: string; + name: string; + createTime: string; + responseTime: string; + title: string; + replicableText: string; + tags: string; + dateFormatting: string; + image: string; + }; + rowEdit: { + title: string; + reset: string; + submit: string; + edit: string; + delete: string; + save: string; + task: string; + score: string; + time: string; + name: string; + action: string; + }; + }; + }; manage: { common: { status: { diff --git a/src/views/pro-naive/form/basic/index.vue b/src/views/pro-naive/form/basic/index.vue index c5f219e0..ca79a69e 100644 --- a/src/views/pro-naive/form/basic/index.vue +++ b/src/views/pro-naive/form/basic/index.vue @@ -2,6 +2,7 @@ import { ref } from 'vue'; import { useMessage } from 'naive-ui'; import { createProForm } from 'pro-naive-ui'; +import { $t } from '@/locales'; const submiting = ref(false); const message = useMessage(); @@ -10,19 +11,21 @@ const form = createProForm({ initialValues: { attributes: [ { - name: '颜色', - items: [{ name: '红' }, { name: '橙' }] + name: $t('page.proNaive.form.basic.color'), + items: [ + { name: $t('page.proNaive.form.basic.specificationColorRed') }, + { name: $t('page.proNaive.form.basic.specificationColorOrange') } + ] } ] }, onReset: () => { - message.success('重置成功'); + message.success('reset success'); }, onSubmit: async values => { - console.log(values); submiting.value = true; await delay(1000); - message.success('提交成功'); + message.success(JSON.stringify(values)); submiting.value = false; } }); @@ -35,7 +38,7 @@ function delay(time: number) { function fillValues() { const values = { - appName: '应用名称', + appName: $t('page.proNaive.form.basic.appName'), appStatus: 0, responseDate: Date.now() }; @@ -62,54 +65,68 @@ function fillValues() { } }" > - + - + - + - +