Ver código fonte

fix: 部门优化

wanggaokun 1 ano atrás
pai
commit
5fa76b8983

+ 1 - 1
src/components/ProForm/index.vue

@@ -134,7 +134,7 @@ watch(
   () => {
     props.itemsOptions.map((item: ProForm.ItemsOptions) => {
       // 如果类型为checkbox,默认值需要设置一个空数组
-      let value = ['checkbox', 'transfer'].includes(item.compOptions.elTagName!) ? [] : null
+      let value = ['checkbox', 'transfer'].includes(item.compOptions.elTagName!) ? [] : props.model[item.prop]
       props.model[item.prop] ? (formModel.value = props.model) : (formModel.value[item.prop] = item.compOptions.value || value)
     })
   },

+ 2 - 3
src/views/system/dept/index.vue

@@ -70,10 +70,9 @@ const openDialog = async (type: number, title: string, row?: any) => {
     itemsOptions.splice(0, 1)
   }
   // 增加子节点
-  if (type == 4 && row?.parentId) {
-    row.parentId = row?.deptId
+  if (type == 4) {
+    row = { parentId: row?.deptId }
   }
-  console.log('row', row)
 
   const params = {
     title,