Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OKR
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hanfeng zhang
OKR
Commits
ee2c6e8a
Commit
ee2c6e8a
authored
Sep 08, 2021
by
hanfeng zhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of gitlab.33.cn:HF_web/OKR
parents
30a875bf
c28b2d16
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
28 deletions
+41
-28
service.dto.ts
src/service/moudles/service.dto.ts
+4
-3
index.ts
src/util/Contact/index.ts
+6
-0
contact-selector.vue
src/views/team/components/contact-selector.vue
+7
-2
member-selector.vue
src/views/team/components/member-selector.vue
+3
-3
team-contacts.vue
src/views/team/components/team-contacts.vue
+12
-12
department-management.vue
src/views/team/department-management.vue
+6
-4
team-frame.vue
src/views/team/team-frame.vue
+3
-4
No files found.
src/service/moudles/service.dto.ts
View file @
ee2c6e8a
export
enum
Role
{
export
enum
Role
{
TEAM_LE
DER
=
0
,
LEA
DER
=
0
,
SUPER_ADMIN
=
1
,
SUPER_ADMIN
=
1
,
CLIENT_MANAGER
=
2
,
CUSTOMER_ADMIN
=
2
,
COMMOM_MEMBER
=
3
COMMON_MEMBER
=
3
,
CHILD_ADMIN
=
4
,
}
}
export
enum
Apply
{
export
enum
Apply
{
...
...
src/util/Contact/index.ts
View file @
ee2c6e8a
...
@@ -2,6 +2,7 @@ import Mock from 'mockjs'
...
@@ -2,6 +2,7 @@ import Mock from 'mockjs'
import
{
strChineseFirstPY
}
from
'./strChineseFirstPY'
import
{
strChineseFirstPY
}
from
'./strChineseFirstPY'
import
{
oMultiDiff
}
from
'./oMultiDiff'
import
{
oMultiDiff
}
from
'./oMultiDiff'
import
{
Staff
}
from
'@/Interface'
import
{
Staff
}
from
'@/Interface'
import
{
Role
}
from
'@/service/moudles/service.dto'
// 参数,中文字符串
// 参数,中文字符串
// 返回值:拼音首字母串数组
// 返回值:拼音首字母串数组
...
@@ -108,3 +109,8 @@ export function getContacts(arr: Array<Staff>) {
...
@@ -108,3 +109,8 @@ export function getContacts(arr: Array<Staff>) {
})
})
return
contacts
return
contacts
}
}
export
function
getLeaders
(
arr
:
Array
<
Staff
>
)
{
if
(
typeof
arr
===
'undefined'
||
arr
.
length
===
0
)
return
[]
return
arr
.
filter
((
item
:
Staff
)
=>
item
.
role
!==
Role
.
COMMON_MEMBER
).
sort
((
a
,
b
)
=>
a
.
role
-
b
.
role
)
}
src/views/team/components/contact-selector.vue
View file @
ee2c6e8a
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
:radio=
"true"
:radio=
"true"
:multiple=
"multiple"
:multiple=
"multiple"
:checked
.
sync=
"checkedMember"
:checked
.
sync=
"checkedMember"
:contact
s
=
"contacts"
:contact
-list
=
"contacts"
/>
/>
</div>
</div>
<!-- 底部操作 -->
<!-- 底部操作 -->
...
@@ -62,7 +62,12 @@ export default Vue.extend({
...
@@ -62,7 +62,12 @@ export default Vue.extend({
type
:
String
,
type
:
String
,
default
:
'团队成员'
default
:
'团队成员'
},
},
contacts
:
Object
,
contacts
:
{
type
:
Array
,
default
()
{
return
[]
}
},
actionType
:
String
actionType
:
String
},
},
data
()
{
data
()
{
...
...
src/views/team/components/member-selector.vue
View file @
ee2c6e8a
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
:radio=
"true"
:radio=
"true"
:multiple=
"multiple"
:multiple=
"multiple"
:checked
.
sync=
"checkedMember"
:checked
.
sync=
"checkedMember"
:contact
s
=
"contacts"
:contact
-list
=
"contacts"
/>
/>
</div>
</div>
<!-- 底部操作 -->
<!-- 底部操作 -->
...
@@ -103,7 +103,7 @@ export default Vue.extend({
...
@@ -103,7 +103,7 @@ export default Vue.extend({
return
{
return
{
team
,
team
,
loading
:
false
,
loading
:
false
,
contacts
:
{}
,
contacts
:
[]
as
Array
<
Staff
>
,
parentId
:
''
,
parentId
:
''
,
entId
:
''
,
entId
:
''
,
ifContainChildDep
:
false
,
ifContainChildDep
:
false
,
...
@@ -197,7 +197,7 @@ export default Vue.extend({
...
@@ -197,7 +197,7 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
currentDep
=
data
.
data
.
dep
this
.
currentDep
=
data
.
data
.
dep
// 通讯录
// 通讯录
this
.
contacts
=
getContacts
(
data
.
data
.
staffList
||
[])
this
.
contacts
=
data
.
data
.
staffList
||
[]
// 部门树
// 部门树
const
depTree
=
data
.
data
.
dep
const
depTree
=
data
.
data
.
dep
depTree
.
children
=
data
.
data
.
subDepList
depTree
.
children
=
data
.
data
.
subDepList
...
...
src/views/team/components/team-contacts.vue
View file @
ee2c6e8a
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</div>
</div>
<template
v-if=
"Object.keys(list).length > 0"
>
<template
v-if=
"Object.keys(list).length > 0"
>
<!-- 主管负责人 -->
<!-- 主管负责人 -->
<div
class=
"leaders"
>
<div
class=
"leaders"
v-if=
"leaders.length > 0"
>
<div
<div
v-for=
"(leader, index) in leaders"
v-for=
"(leader, index) in leaders"
:key=
"index"
:key=
"index"
...
@@ -91,16 +91,17 @@
...
@@ -91,16 +91,17 @@
</template>
</template>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
,
{
PropType
}
from
'vue'
import
{
Staff
,
Contacts
}
from
'@/Interface'
import
{
Staff
,
Contacts
}
from
'@/Interface'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
getContacts
,
getLeaders
}
from
'@/util/Contact'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
props
:
{
props
:
{
contact
s
:
{
contact
List
:
{
type
:
Object
,
type
:
Array
as
PropType
<
Array
<
Staff
>>
,
default
()
{
default
()
{
return
{}
return
[]
}
}
},
},
radio
:
{
radio
:
{
...
@@ -138,15 +139,14 @@ export default Vue.extend({
...
@@ -138,15 +139,14 @@ export default Vue.extend({
},
},
computed
:
{
computed
:
{
leaders
()
{
leaders
()
{
let
arr
:
Array
<
Staff
>
=
[]
return
getLeaders
(
this
.
contactList
)
for
(
const
key
in
this
.
contacts
)
{
},
arr
=
arr
.
concat
(
this
.
contacts
[
key
])
filteredContacts
()
{
}
return
getContacts
(
this
.
contactList
.
filter
((
staff
:
Staff
)
=>
staff
.
role
===
Role
.
COMMON_MEMBER
)
||
[])
return
arr
.
filter
(
item
=>
item
.
role
===
Role
.
TEAM_LEDER
||
item
.
role
===
Role
.
SUPER_ADMIN
).
sort
((
a
,
b
)
=>
b
.
role
-
a
.
role
)
},
},
navs
()
{
navs
()
{
let
arr
:
Array
<
string
>
=
[]
let
arr
:
Array
<
string
>
=
[]
for
(
let
key
in
this
.
c
ontacts
)
{
for
(
let
key
in
this
.
filteredC
ontacts
)
{
if
(
key
!==
'#'
){
if
(
key
!==
'#'
){
arr
.
push
(
key
)
arr
.
push
(
key
)
}
else
{
}
else
{
...
@@ -158,7 +158,7 @@ export default Vue.extend({
...
@@ -158,7 +158,7 @@ export default Vue.extend({
list
()
{
list
()
{
const
obj
:
Contacts
=
{}
const
obj
:
Contacts
=
{}
this
.
navs
.
forEach
(
nav
=>
{
this
.
navs
.
forEach
(
nav
=>
{
obj
[
nav
]
=
this
.
c
ontacts
[
nav
]
obj
[
nav
]
=
this
.
filteredC
ontacts
[
nav
]
})
})
return
obj
return
obj
}
}
...
...
src/views/team/department-management.vue
View file @
ee2c6e8a
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
:multiple=
"multiple"
:multiple=
"multiple"
:action-type=
"actionType"
:action-type=
"actionType"
:contacts=
"contacts"
:contacts=
"contacts"
:leaders=
"leaders"
/>
/>
<div
class=
"pt-14 px-4"
>
<div
class=
"pt-14 px-4"
>
<input-cell
<input-cell
...
@@ -75,7 +76,7 @@
...
@@ -75,7 +76,7 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
Department
,
Staff
}
from
'@/Interface'
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
getContacts
}
from
'@/util/Contact'
import
{
getContacts
,
getLeaders
}
from
'@/util/Contact'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
name
:
'DepartmentManagement'
,
name
:
'DepartmentManagement'
,
...
@@ -105,7 +106,8 @@ export default Vue.extend({
...
@@ -105,7 +106,8 @@ export default Vue.extend({
memberSelectorTitle
:
''
,
memberSelectorTitle
:
''
,
multiple
:
false
,
multiple
:
false
,
contacts
:
{},
contacts
:
[],
leaders
:
[]
as
Array
<
Staff
>
,
showContactSelector
:
false
,
showContactSelector
:
false
,
contactSelectorTitle
:
''
,
contactSelectorTitle
:
''
,
actionType
:
'add'
actionType
:
'add'
...
@@ -162,8 +164,8 @@ export default Vue.extend({
...
@@ -162,8 +164,8 @@ export default Vue.extend({
this
.
loading
=
false
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
// 通讯录
// 通讯录
this
.
contacts
=
getContacts
(
data
.
data
.
staffList
||
[]
)
console
.
log
(
data
.
data
.
staffList
,
'lll'
)
console
.
log
(
this
.
contacts
,
data
.
data
.
staffList
,
'this.contacts'
)
this
.
contacts
=
data
.
data
.
staffList
||
[]
// 部门树
// 部门树
}
else
{
}
else
{
this
.
$toast
(
data
.
msg
)
this
.
$toast
(
data
.
msg
)
...
...
src/views/team/team-frame.vue
View file @
ee2c6e8a
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<team-contacts
<team-contacts
:checked
.
sync=
"checkedMemberId"
:checked
.
sync=
"checkedMemberId"
:contact
s
=
"contacts"
:contact
-list
=
"contacts"
@
click-member=
"clickMember"
@
click-member=
"clickMember"
/>
/>
</div>
</div>
...
@@ -56,7 +56,6 @@
...
@@ -56,7 +56,6 @@
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
appNavBack
,
getUserInfo
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
appNavBack
,
getUserInfo
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
getContacts
}
from
'@/util/Contact'
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
Department
,
Staff
}
from
'@/Interface'
// import {openCompanyUserInfo} from '@/util/Bridge'
// import {openCompanyUserInfo} from '@/util/Bridge'
...
@@ -88,7 +87,7 @@ export default Vue.extend({
...
@@ -88,7 +87,7 @@ export default Vue.extend({
title
:
'导航'
,
title
:
'导航'
,
team
,
team
,
loading
:
false
,
loading
:
false
,
contacts
:
{}
,
contacts
:
[]
as
Array
<
Staff
>
,
parentId
:
''
,
parentId
:
''
,
entId
:
''
,
entId
:
''
,
ifContainChildDep
:
true
,
ifContainChildDep
:
true
,
...
@@ -168,7 +167,7 @@ export default Vue.extend({
...
@@ -168,7 +167,7 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
currentDep
=
data
.
data
.
dep
this
.
currentDep
=
data
.
data
.
dep
// 通讯录
// 通讯录
this
.
contacts
=
getContacts
(
data
.
data
.
staffList
||
[])
this
.
contacts
=
data
.
data
.
staffList
// 部门树
// 部门树
const
depTree
=
data
.
data
.
dep
const
depTree
=
data
.
data
.
dep
depTree
.
children
=
data
.
data
.
subDepList
depTree
.
children
=
data
.
data
.
subDepList
...
...
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