fix: 🧩 修复bug

This commit is contained in:
2025-04-01 15:15:35 +08:00
parent 716b383a87
commit af5894dd5a
25 changed files with 112 additions and 82 deletions

View File

@@ -43,6 +43,7 @@
:formData="dataStore.editFormData"
:rules="dataStore.rules"
ref="formRef"
@handleSelectChangeEmits="handleSelectChangeEmits"
>
</rulesForm>
</div>
@@ -125,7 +126,7 @@ const handleResetClick = () => {
//视频分类接口
const getVideoClassList = async () => {
const result = await getVideoClassListApi({ is_show: 0 });
const result = await getVideoClassListApi();
if (result?.code === 0) {
let arr: any[] = [];
if (result?.data?.length) {
@@ -136,7 +137,7 @@ const getVideoClassList = async () => {
};
arr.push(obj);
});
dataStore.formData[1].options = dataStore.editFormData[1].options = arr;
dataStore.formData[1].options = arr;
}
}
};
@@ -176,8 +177,20 @@ const getVideoRead = async (id: any) => {
const result = await getVideoReadApi(id);
if (result?.code === 0) {
dataStore.editRuleForm = result?.data;
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;
}
};
const handleSelectChangeEmits = (value: any) => {
console.log(value, "========value=========");
dataStore.editRuleForm.category_id = value.id;
};
//保存
const getVideoSave = async () => {
const result = await getVideoSaveApi(dataStore.editRuleForm);