From 8e39e7e70df6402540733b4818caa430e6a47f8b Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Wed, 25 Sep 2024 17:22:22 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=A8=E5=B1=80=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0RichTextarea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/adapter/form.ts | 5 +++++ apps/web-antd/src/views/system/notice/data.ts | 5 ++++- apps/web-antd/src/views/system/notice/notice-modal.vue | 7 +------ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/web-antd/src/adapter/form.ts b/apps/web-antd/src/adapter/form.ts index c84dded8..b46f9b21 100644 --- a/apps/web-antd/src/adapter/form.ts +++ b/apps/web-antd/src/adapter/form.ts @@ -34,6 +34,8 @@ import { } from 'ant-design-vue'; import { isArray } from 'lodash-es'; +import { Tinymce as RichTextarea } from '#/components/tinymce'; + // 这里需要自行根据业务组件库进行适配,需要用到的组件都需要在这里类型说明 export type FormComponentType = | 'AutoComplete' @@ -49,6 +51,7 @@ export type FormComponentType = | 'RadioGroup' | 'RangePicker' | 'Rate' + | 'RichTextarea' | 'Select' | 'Space' | 'Switch' @@ -82,6 +85,7 @@ setupVbenForm({ RadioGroup, RangePicker, Rate, + RichTextarea, Select, Space, Switch, @@ -98,6 +102,7 @@ setupVbenForm({ modelPropNameMap: { Checkbox: 'checked', Radio: 'checked', + RichTextarea: 'modelValue', Switch: 'checked', Upload: 'fileList', }, diff --git a/apps/web-antd/src/views/system/notice/data.ts b/apps/web-antd/src/views/system/notice/data.ts index c3c6e240..c9d2c0d2 100644 --- a/apps/web-antd/src/views/system/notice/data.ts +++ b/apps/web-antd/src/views/system/notice/data.ts @@ -81,7 +81,10 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'required', }, { - component: 'Input', + component: 'RichTextarea', + componentProps: { + width: '100%', + }, fieldName: 'noticeContent', formItemClass: 'col-span-2', label: '公告内容', diff --git a/apps/web-antd/src/views/system/notice/notice-modal.vue b/apps/web-antd/src/views/system/notice/notice-modal.vue index d735de63..0c5c6343 100644 --- a/apps/web-antd/src/views/system/notice/notice-modal.vue +++ b/apps/web-antd/src/views/system/notice/notice-modal.vue @@ -7,7 +7,6 @@ import { cloneDeep } from '@vben/utils'; import { useVbenForm } from '#/adapter'; import { noticeAdd, noticeInfo, noticeUpdate } from '#/api/system/notice'; -import { Tinymce } from '#/components/tinymce'; import { modalSchema } from './data'; @@ -70,10 +69,6 @@ async function handleCancel() {