mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-26 22:31:21 +00:00
feat(tenant): 添加租户编码字段及相关功能
- 在后端模型、schema和前端接口中添加code字段 - 在前端表格和表单中显示和编辑code字段 - 修改租户名称长度限制从50到64字符 - 添加编码字段的验证逻辑 - 更新WangEditor组件返回纯文本格式
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
* 项目地址:https://gitee.com/youlaiorg/vue3-element-admin
|
||||
*
|
||||
* 在使用时,请保留此注释,感谢您对开源的支持!
|
||||
*
|
||||
* 修改:此版本返回纯文本格式,使用 editor.getText() 获取内容
|
||||
-->
|
||||
|
||||
<template>
|
||||
@@ -24,6 +26,7 @@
|
||||
:default-config="editorConfig"
|
||||
mode="simple"
|
||||
@on-created="handleCreated"
|
||||
@on-change="handleChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -92,6 +95,15 @@ const handleCreated = (editor: any) => {
|
||||
editorRef.value = editor;
|
||||
};
|
||||
|
||||
// 处理内容变化 - 获取纯文本而不是HTML
|
||||
const handleChange = (editor: any) => {
|
||||
editorRef.value = editor;
|
||||
if (editorRef.value) {
|
||||
const text = editorRef.value.getText();
|
||||
modelValue.value = text;
|
||||
}
|
||||
};
|
||||
|
||||
// 组件销毁时,也及时销毁编辑器,重要!
|
||||
onBeforeUnmount(() => {
|
||||
const editor = editorRef.value;
|
||||
|
||||
Reference in New Issue
Block a user