feat(tenant): 添加租户编码字段及相关功能

- 在后端模型、schema和前端接口中添加code字段
- 在前端表格和表单中显示和编辑code字段
- 修改租户名称长度限制从50到64字符
- 添加编码字段的验证逻辑
- 更新WangEditor组件返回纯文本格式
This commit is contained in:
zhangtao
2025-11-13 23:47:52 +08:00
parent 196d8e1026
commit 086bce3972
6 changed files with 46 additions and 7 deletions
@@ -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;