Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-app-operator-master
Commits
48692a00
Commit
48692a00
authored
Dec 26, 2022
by
houjn@hikoon.cn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
部门目标设置时,显示多级部门名称
parent
20b1178e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
18 deletions
+51
-18
index.vue
src/views/ecw/deptTarget/index.vue
+51
-18
No files found.
src/views/ecw/deptTarget/index.vue
View file @
48692a00
...
...
@@ -148,7 +148,7 @@
getCreateInitData
,
getPersonTargetPage
}
from
"
@/api/ecw/deptTarget
"
;
import
{
listSimpleDepts
}
from
"
@/api/system/dept
"
;
import
{
list
Dept
,
list
SimpleDepts
}
from
"
@/api/system/dept
"
;
import
{
getChannelList
}
from
'
@/api/ecw/channel
'
;
import
dayjs
from
"
dayjs
"
;
import
{
parseTime
}
from
'
@/utils/ruoyi
'
;
...
...
@@ -237,24 +237,27 @@ import { parseTime } from '@/utils/ruoyi';
}
},
created
()
{
listSimpleDepts
().
then
(
res
=>
{
res
.
data
.
forEach
((
item
)
=>
{
if
(
item
.
parentId
==
0
)
{
this
.
getDeptList
();
this
.
deptArr
.
push
(
item
)
}
else
{
this
.
deptData
.
push
(
item
)
}
})
this
.
deptData
.
forEach
((
value
)
=>
{
var
dept
=
this
.
deptArr
.
filter
(
itt
=>
itt
.
id
==
value
.
parentId
)
if
(
dept
.
length
>
0
)
{
value
.
name
=
dept
[
0
].
name
+
'
|
'
+
value
.
name
}
})
});
// listSimpleDepts().then(res => {
// this.deptList = this.handleTree(res, "id");
// console.log("this.deptList:"+JSON.stringify(this.deptList));
// res.data.forEach((item) => {
// if (item.parentId == 0) {
// this.deptArr.push(item)
// }
// else {
// this.deptData.push(item)
// }
// })
// this.deptData.forEach((value) => {
// var dept = this.deptArr.filter(itt => itt.id == value.parentId)
// if (dept.length > 0) {
// value.name = dept[0].name + ' | ' + value.name
// }
//
// })
// });
getCreateInitData
().
then
(
res
=>
{
this
.
monthList
=
res
.
data
.
month
;
this
.
quarterList
=
res
.
data
.
quarter
;
...
...
@@ -264,6 +267,36 @@ import { parseTime } from '@/utils/ruoyi';
this
.
getList
();
},
methods
:
{
/** 查询部门列表 */
getDeptList
(){
this
.
loading
=
true
;
listDept
(
this
.
queryParams
).
then
(
response
=>
{
this
.
deptList
=
this
.
handleTree
(
response
.
data
,
"
id
"
);
console
.
log
(
"
this.deptList:
"
+
JSON
.
stringify
(
this
.
deptList
));
this
.
deptList
.
forEach
((
item
)
=>
{
this
.
normalizer
(
item
);
// this.deptData.push(item);
// if(item.children!=null&&item.children.length>0){
// item.children.forEach((c) => {
// c.name = item.name +"|"+ c.name;
// this.deptData.push(c);
// });
// }
});
// this.loading = false;
});
},
normalizer
(
item
)
{
this
.
deptData
.
push
(
item
);
if
(
item
.
children
!=
null
&&
item
.
children
.
length
>
0
){
item
.
children
.
forEach
((
c
)
=>
{
c
.
name
=
item
.
name
+
"
|
"
+
c
.
name
;
this
.
normalizer
(
c
);
// this.deptData.push(c);
});
}
return
item
;
},
getChannelList
()
{
getChannelList
().
then
(
res
=>
this
.
channelList
=
res
.
data
)
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment