feat: 🚀 切换富文本编辑器

This commit is contained in:
2025-05-07 17:55:49 +08:00
parent 4bd5797772
commit ab003714bf
28 changed files with 1145 additions and 132 deletions

View File

@@ -38,7 +38,7 @@ import {
getArticleListExportApi,
getArticleListDelApi
} from "@/api/modules/articleList";
import { useSearchInfoArray } from "@/hooks/useSearch";
// import { useSearchInfoArray } from "@/hooks/useSearch";
//深拷贝方法
import { cloneDeep } from "lodash-es";
//表格和搜索條件
@@ -57,13 +57,26 @@ const dataStore = reactive<any>({
formData: FORM_DATA, //搜索配置项
selectRow: {} //当前选择的row
});
const addLabelValue = (arr: any) => {
return arr.map((item: any) => {
// 为当前对象添加 label 和 value 属性
const newItem = { ...item };
newItem.label = newItem.name;
newItem.value = newItem.id;
// 如果有子对象,递归调用 addLabelValue 处理子对象
if (newItem.children && Array.isArray(newItem.children)) {
newItem.children = addLabelValue(newItem.children);
}
return newItem;
});
};
//文章分类(搜索条件)
const getArticleClassData = async () => {
const result = await getArticleClassDataApi();
if (result?.code === 0) {
const { data } = result;
dataStore.formData[1].options = useSearchInfoArray(data);
dataStore.formData[1].options = addLabelValue(data);
}
};
getArticleClassData();