refactor(chat): 优化聊天消息编辑组件代码结构
- 移除不必要的代码注释和冗余逻辑 - 简化表单验证函数参数传递 - 删除重复的类型定义和无用变量 - 统一事件处理函数命名风格 - 清理未使用的插件引用和样式文件 - 优化条件判断语句提高可读性
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -92,8 +92,6 @@
|
|||||||
// 中文语言文件
|
// 中文语言文件
|
||||||
import zh_Hans from 'bytemd/locales/zh_Hans.json';
|
import zh_Hans from 'bytemd/locales/zh_Hans.json';
|
||||||
import 'bytemd/dist/index.min.css';
|
import 'bytemd/dist/index.min.css';
|
||||||
import highlight from '@bytemd/plugin-highlight-ssr';
|
|
||||||
import 'highlight.js/styles/default.css';
|
|
||||||
import { ShopMerchantAccount } from '@/api/shop/shopMerchantAccount/model';
|
import { ShopMerchantAccount } from '@/api/shop/shopMerchantAccount/model';
|
||||||
import { User } from '@/api/system/user/model';
|
import { User } from '@/api/system/user/model';
|
||||||
|
|
||||||
@@ -173,7 +171,7 @@
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
message: '请填写消息内容',
|
message: '请填写消息内容',
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
validator: async (_rule: RuleObject, value: string) => {
|
validator: async (_rule: RuleObject, _: string) => {
|
||||||
if (content.value == '') {
|
if (content.value == '') {
|
||||||
return Promise.reject('请填写消息内容');
|
return Promise.reject('请填写消息内容');
|
||||||
}
|
}
|
||||||
@@ -187,8 +185,7 @@
|
|||||||
const plugins = ref([
|
const plugins = ref([
|
||||||
gfm({
|
gfm({
|
||||||
locale: zh_HansGfm
|
locale: zh_HansGfm
|
||||||
}),
|
})
|
||||||
highlight()
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onToUser = (item: User) => {
|
const onToUser = (item: User) => {
|
||||||
@@ -199,7 +196,7 @@
|
|||||||
// form.toUserName = item.nickname;
|
// form.toUserName = item.nickname;
|
||||||
};
|
};
|
||||||
|
|
||||||
const chooseType = (item: any) => {
|
const chooseType = (_: any) => {
|
||||||
form.type = 'text';
|
form.type = 'text';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user