feat: 🚀 切换富文本编辑器
This commit is contained in:
@@ -59,6 +59,7 @@ import { useMsg } from "@/hooks/useMsg";
|
||||
import { Delete } from "@element-plus/icons-vue";
|
||||
const $route = useRoute();
|
||||
import { getCategorysApi } from "@/api/modules/downloadClass";
|
||||
import { recursiveCompare } from "@/utils/recursiveCompare";
|
||||
//深拷贝方法
|
||||
import { cloneDeep } from "lodash-es";
|
||||
import {
|
||||
@@ -219,6 +220,20 @@ const handleEditAdd = () => {
|
||||
file_ext: "" //文件格式
|
||||
});
|
||||
};
|
||||
// const recursiveCompare = (item: any, targetId: any) => {
|
||||
// if (typeof item === "object" && item !== null) {
|
||||
// if (item.value !== undefined && item.value === targetId) {
|
||||
// return true;
|
||||
// }
|
||||
// for (const key in item) {
|
||||
// if (recursiveCompare(item[key], targetId)) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// };
|
||||
|
||||
//详情
|
||||
const getAttachmentRead = async () => {
|
||||
let id = $route.query.id;
|
||||
@@ -229,12 +244,16 @@ const getAttachmentRead = async () => {
|
||||
if (result?.code === 0) {
|
||||
dataStore.editRuleForm = result?.data;
|
||||
dataStore.editTableData = result?.data.attach;
|
||||
|
||||
let is = dataStore.editFormData[1].options.some((item: any) => {
|
||||
console.log(item.id);
|
||||
console.log(dataStore.editRuleForm.category_id);
|
||||
return item.value == dataStore.editRuleForm.category_id;
|
||||
});
|
||||
//recursiveCompare
|
||||
let is = dataStore.editFormData[1].options.some((item: any) =>
|
||||
recursiveCompare(item, dataStore.editRuleForm.category_id)
|
||||
);
|
||||
console.log(is, "========is==========");
|
||||
// let is = dataStore.editFormData[1].options.some((item: any) => {
|
||||
// console.log(item.id);
|
||||
// console.log(dataStore.editRuleForm.category_id);
|
||||
// return item.value == dataStore.editRuleForm.category_id;
|
||||
// });
|
||||
dataStore.editRuleForm.category_id1 = is ? dataStore.editRuleForm.category_id : dataStore.editRuleForm.category_name;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user