|
@@ -64,6 +64,7 @@ import * as DeptApi from '@/api/system/dept'
|
|
|
import * as UserApi from '@/api/system/user'
|
|
|
import { CommonStatusEnum } from '@/utils/constants'
|
|
|
import { FormRules } from 'element-plus'
|
|
|
+import { IotTreeApi, IotTreeVO } from '@/api/system/tree'
|
|
|
|
|
|
defineOptions({ name: 'SystemDeptForm' })
|
|
|
|
|
@@ -133,10 +134,20 @@ const submitForm = async () => {
|
|
|
try {
|
|
|
const data = formData.value as unknown as DeptApi.DeptVO
|
|
|
if (formType.value === 'create') {
|
|
|
- await DeptApi.createDept(data)
|
|
|
+ await DeptApi.createDept(data).then(res => {
|
|
|
+ DeptApi.getDept(res).then(re => {
|
|
|
+ console.log(JSON.stringify(re))
|
|
|
+ debugger
|
|
|
+ IotTreeApi.createDeptDeal(re)
|
|
|
+ })
|
|
|
+ })
|
|
|
message.success(t('common.createSuccess'))
|
|
|
} else {
|
|
|
- await DeptApi.updateDept(data)
|
|
|
+ await DeptApi.updateDept(data).then(res => {
|
|
|
+ DeptApi.getDept(data.id).then(re => {
|
|
|
+ IotTreeApi.updateDeptDeal(re)
|
|
|
+ })
|
|
|
+ })
|
|
|
message.success(t('common.updateSuccess'))
|
|
|
}
|
|
|
dialogVisible.value = false
|