fix: 🧩 bug修复

This commit is contained in:
2025-07-01 16:00:05 +08:00
parent fd35dc532b
commit 8524d2112e
7 changed files with 22 additions and 14 deletions

View File

@@ -140,7 +140,7 @@ const getProductCategoryList = async () => {
const result = await getProductCategoryListApi();
if (result?.code === 0) {
let dataClone: any = cloneDeep(result?.data);
dataStore.editFormData[6].options = addLabelValue(dataClone);
dataStore.editFormData[7].options = addLabelValue(dataClone);
}
};
@@ -280,12 +280,12 @@ const getBannerUp = async () => {
const getBannerClassEditList = async () => {
const result = await getBannerClassListApi();
if (result?.code === 0) {
// let arr: any = [];
// result?.data?.forEach((item: any) => {
// arr.push({ value: item.id, label: item.name });
// });
dataStore.formData[1].options = addLabelValue(result?.data);
dataStore.editFormData[5].options = addLabelValue(result?.data);
dataStore.editFormData.forEach((item: any) => {
if (item.prop === "banner_id") {
item.options = addLabelValue(result?.data);
}
});
}
};
getBannerClassEditList();
@@ -334,6 +334,7 @@ const resetFields = () => {
// 抽屉重置
const handleResetClick = () => {
if (dataStore.title === "添加Banner") {
console.log("12323");
resetFields();
} else {
getBannerRead(dataStore.editRuleForm.id);
@@ -343,14 +344,17 @@ const handleResetClick = () => {
const handleAdd = () => {
dataStore.title = "添加Banner";
dataStore.visible = true;
getBannerClassEditList();
dataStore.editRuleForm = cloneDeep(EDIT_RULE_FORM);
(dataStore.editFormData = cloneDeep(EDIT_FORM_DATA)), // 抽屉表单配置项
getBannerClassEditList();
// getBannerClassList();
getProductCategoryList();
};
// 抽屉关闭前的钩子
const handleBeforeClone = () => {
dataStore.editRuleForm = cloneDeep(EDIT_RULE_FORM);
resetFields();
(dataStore.editFormData = cloneDeep(EDIT_FORM_DATA)), // 抽屉表单配置项
resetFields();
dataStore.visible = false;
dataStore.isFirstRequest = true;
};