前端删除的报错修改

cloud-ui
刘河平 2024-11-15 12:09:43 +08:00
parent 083fbc8394
commit 642c12457c
1 changed files with 2 additions and 2 deletions

View File

@ -244,7 +244,7 @@ export default {
watch: { watch: {
'form.parentId': { 'form.parentId': {
handler(val){ handler(val){
if (val !== undefined && val !== 0){ if (val !== undefined && val !== 0 && val !== null){
parentCommonElement(val).then(response => { parentCommonElement(val).then(response => {
this.attributeInfoList = response.data.attributeInfoList; this.attributeInfoList = response.data.attributeInfoList;
this.attributeGroupList = response.data.attributeGroupList; this.attributeGroupList = response.data.attributeGroupList;
@ -342,7 +342,7 @@ export default {
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
this.getTreeselect(); this.getTreeselect();
if (row != null) { if (row != null && row.id) {
this.form.parentId = row.parentId; this.form.parentId = row.parentId;
} }
getCategory(row.id).then(response => { getCategory(row.id).then(response => {