From d985ef194e4300772cc83c0b69f4167194af35d3 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 11 Feb 2023 15:54:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20post=20=E5=B2=97=E4=BD=8D?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91=E5=AE=9E=E7=8E=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/src/helper.ts | 4 +- src/locales/en.ts | 1 + src/locales/zh-CN.ts | 1 + .../system/post/{PostForm.vue => form.vue} | 47 ++++++++++--------- src/views/system/post/index.vue | 31 +++++++----- src/views/system/post/post.data.ts | 14 ++++-- 6 files changed, 56 insertions(+), 42 deletions(-) rename src/views/system/post/{PostForm.vue => form.vue} (70%) diff --git a/src/components/Form/src/helper.ts b/src/components/Form/src/helper.ts index e2549cbd..9cab8ff1 100644 --- a/src/components/Form/src/helper.ts +++ b/src/components/Form/src/helper.ts @@ -16,7 +16,7 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { const selectMap = ['Select', 'SelectV2', 'TimePicker', 'DatePicker', 'TimeSelect', 'TimeSelect'] if (textMap.includes(schema?.component as string)) { return { - placeholder: t('common.inputText') + placeholder: t('common.inputText') + schema.label } } if (selectMap.includes(schema?.component as string)) { @@ -34,7 +34,7 @@ export const setTextPlaceholder = (schema: FormSchema): PlaceholderMoel => { } } else { return { - placeholder: t('common.selectText') + placeholder: t('common.selectText') + schema.label } } } diff --git a/src/locales/en.ts b/src/locales/en.ts index ed5bf72c..1600a19f 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -281,6 +281,7 @@ export default { create: 'Create', add: 'Add', del: 'Delete', + delete: 'Delete', edit: 'Edit', update: 'Update', preview: 'Preview', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 7faf145d..7c5742c4 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -281,6 +281,7 @@ export default { create: '新增', add: '新增', del: '删除', + delete: '删除', edit: '编辑', update: '编辑', preview: '预览', diff --git a/src/views/system/post/PostForm.vue b/src/views/system/post/form.vue similarity index 70% rename from src/views/system/post/PostForm.vue rename to src/views/system/post/form.vue index ab3a23af..357a27a2 100644 --- a/src/views/system/post/PostForm.vue +++ b/src/views/system/post/form.vue @@ -1,6 +1,6 @@ + + diff --git a/src/views/system/post/post.data.ts b/src/views/system/post/post.data.ts index 7a32b233..4926bcc6 100644 --- a/src/views/system/post/post.data.ts +++ b/src/views/system/post/post.data.ts @@ -8,10 +8,10 @@ export const rules = reactive({ sort: [required] }) -// CrudSchema +// 增删改查 CrudSchema 配置 const crudSchemas = reactive({ primaryKey: 'id', - primaryType: 'seq', + primaryType: 'id', primaryTitle: '岗位编号', action: true, columns: [ @@ -27,7 +27,10 @@ const crudSchemas = reactive({ }, { title: '岗位顺序', - field: 'sort' + field: 'sort', + form: { + component: 'InputNumber' + } }, { title: t('common.status'), @@ -45,7 +48,10 @@ const crudSchemas = reactive({ title: t('common.createTime'), field: 'createTime', formatter: 'formatDate', - isForm: false + isForm: false, + table: { + width: 180 + } } ] })