fix: 🧩 修复bug
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user