|
@@ -614,17 +614,24 @@ export default {
|
|
let postDeptArr = []
|
|
let postDeptArr = []
|
|
if(data.postDeptIds) {
|
|
if(data.postDeptIds) {
|
|
const postDept = JSON.parse(data.postDeptIds) || []
|
|
const postDept = JSON.parse(data.postDeptIds) || []
|
|
- postDept.forEach(dept => {
|
|
|
|
- let deptIds = dept.deptIds || []
|
|
|
|
- let deptArr = []
|
|
|
|
- deptIds.forEach(ds => {
|
|
|
|
- deptArr.push(this.formatParentId(ds, this.deptList))
|
|
|
|
- })
|
|
|
|
- postDeptArr.push({
|
|
|
|
- postId: dept.postId,
|
|
|
|
- deptIds: deptArr
|
|
|
|
|
|
+ if(postDept.length > 0) {
|
|
|
|
+ postDept.forEach(dept => {
|
|
|
|
+ let deptIds = dept.deptIds || []
|
|
|
|
+ let deptArr = []
|
|
|
|
+ deptIds.forEach(ds => {
|
|
|
|
+ deptArr.push(this.formatParentId(ds, this.deptList))
|
|
|
|
+ })
|
|
|
|
+ postDeptArr.push({
|
|
|
|
+ postId: dept.postId,
|
|
|
|
+ deptIds: deptArr
|
|
|
|
+ })
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ } else {
|
|
|
|
+ postDeptArr = [{
|
|
|
|
+ postId: null,
|
|
|
|
+ deptIds: []
|
|
|
|
+ }]
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
postDeptArr = [{
|
|
postDeptArr = [{
|
|
postId: null,
|
|
postId: null,
|