调整分类管理级联选择器value字段映射从id改为bid,优化提交数据结构显式声明字段并处理parentId空值情况

This commit is contained in:
2026-03-16 17:10:03 +08:00
parent ef1c13dcd2
commit b57652aea4

View File

@@ -6,7 +6,7 @@
<el-cascader
v-model="ruleForm.parentId"
:options="categoryData"
:props="{ checkStrictly: true, emitPath: false, value: 'id', label: 'name', children: 'children' }"
:props="{ checkStrictly: true, emitPath: false, value: 'bid', label: 'name', children: 'children' }"
placeholder="请选择上级分类"
clearable
:disabled="isEdit || isAddChild"
@@ -440,7 +440,10 @@ const buildSubmitData = () => {
});
return {
...ruleForm,
id: ruleForm.id,
parentId: ruleForm.parentId ?? '',
name: ruleForm.name,
sort: ruleForm.sort,
attrs: processedAttrs,
};
};