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
9633375d
Commit
9633375d
authored
Sep 09, 2021
by
sixiaofeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ff695904
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
169 additions
and
84 deletions
+169
-84
index.ts
src/Interface/index.ts
+30
-8
index.ts
src/util/Common/index.ts
+4
-5
index.ts
src/util/Contact/index.ts
+1
-1
add-member.vue
src/views/team/add-member.vue
+1
-1
contact-member.vue
src/views/team/components/contact-member.vue
+12
-0
contact-selector.vue
src/views/team/components/contact-selector.vue
+21
-5
dep-selector.vue
src/views/team/components/dep-selector.vue
+11
-3
member-selector.vue
src/views/team/components/member-selector.vue
+9
-7
team-contacts.vue
src/views/team/components/team-contacts.vue
+38
-19
department-management.vue
src/views/team/department-management.vue
+13
-6
team-frame.vue
src/views/team/team-frame.vue
+29
-29
No files found.
src/Interface/index.ts
View file @
9633375d
...
@@ -33,13 +33,34 @@ export interface Department {
...
@@ -33,13 +33,34 @@ export interface Department {
}
}
export
interface
LocalStore
{
export
interface
LocalStore
Ent
{
avatar
:
string
avatar
:
string
description
:
string
description
:
string
id
:
string
id
:
string
imServer
:
string
imServer
:
string
name
:
string
name
:
string
nodeServer
:
string
nodeServer
:
string
oaServer
:
string
oaServer
:
string
rootDepId
:
string
rootDepId
:
string
}
export
interface
LocalStoreUsr
{
entId
:
string
,
depId
:
string
,
id
:
string
,
joinTime
:
number
,
name
:
string
,
phone
:
string
,
position
:
string
,
role
:
number
,
company
?:
{
avator
:
string
,
description
:
string
,
id
:
string
,
imServer
:
string
,
name
:
string
,
nodeServer
:
string
,
oaServer
:
string
,
rootDepId
:
string
}
}
}
\ No newline at end of file
src/util/Common/index.ts
View file @
9633375d
import
{
LocalStoreEnt
,
LocalStoreUsr
}
from
"@/Interface"
export
function
trim
(
str
:
string
)
{
export
function
trim
(
str
:
string
)
{
return
str
.
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
''
)
return
str
.
replace
(
/
(
^
\s
*
)
|
(\s
*$
)
/g
,
''
)
}
}
export
function
generateTree
(
arr
:
Array
<
any
>
,
rootId
:
string
)
{
console
.
log
(
arr
,
rootId
)
}
export
function
formatFileSize
(
size
:
number
)
{
export
function
formatFileSize
(
size
:
number
)
{
const
kb
=
size
/
1024
const
kb
=
size
/
1024
const
mb
=
kb
/
1024
const
mb
=
kb
/
1024
...
@@ -14,4 +12,4 @@ export function formatFileSize(size: number) {
...
@@ -14,4 +12,4 @@ export function formatFileSize(size: number) {
}
else
{
}
else
{
return
kb
.
toFixed
(
3
)
+
'KB'
return
kb
.
toFixed
(
3
)
+
'KB'
}
}
}
}
\ No newline at end of file
src/util/Contact/index.ts
View file @
9633375d
...
@@ -115,7 +115,7 @@ export function getLeaders(arr: Array<Staff>) {
...
@@ -115,7 +115,7 @@ export function getLeaders(arr: Array<Staff>) {
return
arr
.
filter
((
item
:
Staff
)
=>
item
.
role
!==
Role
.
COMMON_MEMBER
).
sort
((
a
,
b
)
=>
a
.
role
-
b
.
role
)
return
arr
.
filter
((
item
:
Staff
)
=>
item
.
role
!==
Role
.
COMMON_MEMBER
).
sort
((
a
,
b
)
=>
a
.
role
-
b
.
role
)
}
}
export
function
uniqueArr
(
arr
:
Array
<
Staff
>
)
{
export
function
uniqueArr
(
arr
:
Staff
[]
)
{
if
(
typeof
arr
===
'undefined'
||
arr
.
length
===
0
)
return
[]
if
(
typeof
arr
===
'undefined'
||
arr
.
length
===
0
)
return
[]
const
res
=
new
Map
()
const
res
=
new
Map
()
return
arr
.
filter
(
item
=>
{
return
arr
.
filter
(
item
=>
{
...
...
src/views/team/add-member.vue
View file @
9633375d
...
@@ -82,7 +82,7 @@ import Vue from 'vue'
...
@@ -82,7 +82,7 @@ import Vue from 'vue'
import
{
Calendar
,
Overlay
}
from
'vant'
import
{
Calendar
,
Overlay
}
from
'vant'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
{
trim
}
from
'@/util/Contact'
import
{
trim
}
from
'@/util/Contact'
import
{
Department
,
LocalStore
}
from
'@/Interface'
import
{
Department
}
from
'@/Interface'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
formatDate
}
from
'@/util/FormatDate'
import
{
formatDate
}
from
'@/util/FormatDate'
import
DepSelector
from
'@/views/team/components/dep-selector.vue'
import
DepSelector
from
'@/views/team/components/dep-selector.vue'
...
...
src/views/team/components/contact-member.vue
View file @
9633375d
...
@@ -13,6 +13,12 @@
...
@@ -13,6 +13,12 @@
>
>
{{
tagName
(
member
)
}}
{{
tagName
(
member
)
}}
</div>
</div>
<div
v-if=
"showTitle"
class=
"tag ml-1.5 text-xs text-white px-1 py-0.5 bg-color-primary rounded"
>
{{
title
}}
</div>
</div>
</div>
</
template
>
</
template
>
...
@@ -32,6 +38,12 @@ export default Vue.extend({
...
@@ -32,6 +38,12 @@ export default Vue.extend({
default
()
{
default
()
{
return
{}
return
{}
}
}
},
title
:
String
},
computed
:
{
showTitle
():
boolean
{
return
typeof
this
.
title
!==
'undefined'
&&
this
.
title
!==
''
}
}
},
},
methods
:
{
methods
:
{
...
...
src/views/team/components/contact-selector.vue
View file @
9633375d
<
template
>
<
template
>
<!-- 选择成员 -->
<!-- 选择成员 -->
<van-overlay
:show=
"show"
z-index=
"2000"
:lock-scroll=
"false"
>
<van-overlay
:show=
"show"
z-index=
"2000"
:lock-scroll=
"false"
>
<div
class=
"select-team w-screen h-screen overflow-auto"
>
<div
class=
"select-team w-screen h-screen overflow-auto"
id=
"contact-selector"
>
<main-page
<main-page
main-bg=
"bg-white"
main-bg=
"bg-white"
header-bg=
"bg-white"
header-bg=
"bg-white"
...
@@ -13,10 +13,12 @@
...
@@ -13,10 +13,12 @@
<div
class=
"px-4 pt-14"
>
<div
class=
"px-4 pt-14"
>
<!--
<div
class=
"py-2"
>
{{
currentDep
.
name
}}
</div>
-->
<!--
<div
class=
"py-2"
>
{{
currentDep
.
name
}}
</div>
-->
<!-- 通讯录 -->
<!-- 通讯录 -->
<div
class=
"py-2 font-medium"
>
{{
dep
.
name
}}
</div>
<div
class=
"py-2 font-medium"
>
{{
contactTitle
?
contactTitle
:
dep
.
name
}}
</div>
<div
class=
"pb-16"
>
<div
class=
"pb-16"
>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<team-contacts
<team-contacts
container-id=
"contact-selector"
:leader=
"leader"
:radio=
"true"
:radio=
"true"
:multiple=
"multiple"
:multiple=
"multiple"
:checked
.
sync=
"checkedMember"
:checked
.
sync=
"checkedMember"
...
@@ -37,6 +39,11 @@
...
@@ -37,6 +39,11 @@
import
Vue
,
{
PropType
}
from
'vue'
import
Vue
,
{
PropType
}
from
'vue'
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
Department
,
Staff
}
from
'@/Interface'
interface
Leader
{
list
:
Staff
[],
title
?:
string
}
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
name
:
'ContactSelector'
,
name
:
'ContactSelector'
,
components
:
{
components
:
{
...
@@ -68,7 +75,16 @@ export default Vue.extend({
...
@@ -68,7 +75,16 @@ export default Vue.extend({
return
[]
return
[]
}
}
},
},
actionType
:
String
leader
:
{
type
:
Object
as
PropType
<
Leader
>
,
default
()
{
return
{
list
:
[]
}
}
},
actionType
:
String
,
contactTitle
:
String
},
},
data
()
{
data
()
{
let
changedVal
:
Array
<
string
>
=
[]
let
changedVal
:
Array
<
string
>
=
[]
...
@@ -80,14 +96,14 @@ export default Vue.extend({
...
@@ -80,14 +96,14 @@ export default Vue.extend({
},
},
computed
:
{
computed
:
{
checkedMember
:
{
checkedMember
:
{
get
():
Array
<
String
>
{
get
():
string
[]
{
if
(
!
this
.
changed
)
{
if
(
!
this
.
changed
)
{
return
this
.
checkedMemberId
return
this
.
checkedMemberId
}
else
{
}
else
{
return
this
.
changedVal
return
this
.
changedVal
}
}
},
},
set
(
val
:
Array
<
string
>
)
{
set
(
val
:
string
[]
)
{
this
.
changed
=
true
this
.
changed
=
true
this
.
changedVal
=
val
this
.
changedVal
=
val
}
}
...
...
src/views/team/components/dep-selector.vue
View file @
9633375d
...
@@ -114,7 +114,7 @@ export default Vue.extend({
...
@@ -114,7 +114,7 @@ export default Vue.extend({
},
},
methods
:
{
methods
:
{
showChecked
(
dep
:
Department
):
boolean
{
showChecked
(
dep
:
Department
):
boolean
{
return
(
!
this
.
checked
&&
this
.
selected
===
dep
.
id
)
||
this
.
checked
===
dep
.
id
return
this
.
checked
===
dep
.
id
},
},
goBack
()
{
goBack
()
{
this
.
$emit
(
'update:show'
,
false
)
this
.
$emit
(
'update:show'
,
false
)
...
@@ -145,7 +145,7 @@ export default Vue.extend({
...
@@ -145,7 +145,7 @@ export default Vue.extend({
// 所有部门
// 所有部门
goPre
()
{
goPre
()
{
this
.
depId
=
this
.
currentDep
.
parentId
this
.
depId
=
this
.
currentDep
.
parentId
this
.
checked
=
''
this
.
checked
=
this
.
selected
this
.
getSub
()
this
.
getSub
()
},
},
// 选择
// 选择
...
@@ -157,7 +157,6 @@ export default Vue.extend({
...
@@ -157,7 +157,6 @@ export default Vue.extend({
},
},
// 确认选择
// 确认选择
confirm
()
{
confirm
()
{
console
.
log
(
this
.
checked
,
'ched'
)
if
(
this
.
checked
===
''
)
{
if
(
this
.
checked
===
''
)
{
this
.
$toast
(
'请选择部门'
)
this
.
$toast
(
'请选择部门'
)
return
return
...
@@ -165,6 +164,15 @@ export default Vue.extend({
...
@@ -165,6 +164,15 @@ export default Vue.extend({
this
.
$emit
(
'update:selected'
,
this
.
checked
)
this
.
$emit
(
'update:selected'
,
this
.
checked
)
this
.
$emit
(
'update:show'
,
false
)
this
.
$emit
(
'update:show'
,
false
)
}
}
},
watch
:
{
show
(
val
:
boolean
)
{
if
(
val
)
{
this
.
checked
=
this
.
selected
}
else
{
this
.
checked
=
''
}
}
}
}
})
})
</
script
>
</
script
>
...
...
src/views/team/components/member-selector.vue
View file @
9633375d
<
template
>
<
template
>
<!-- 选择成员 -->
<!-- 选择成员 -->
<van-overlay
:show=
"show"
z-index=
"2000"
:lock-scroll=
"false"
>
<van-overlay
:show=
"show"
z-index=
"2000"
:lock-scroll=
"false"
>
<div
class=
"select-team w-screen h-screen overflow-auto"
>
<div
class=
"select-team w-screen h-screen overflow-auto"
id=
"member-selector"
>
<main-page
<main-page
main-bg=
"bg-white"
main-bg=
"bg-white"
header-bg=
"bg-white"
header-bg=
"bg-white"
...
@@ -38,6 +38,8 @@
...
@@ -38,6 +38,8 @@
<div
class=
"pb-16"
>
<div
class=
"pb-16"
>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<team-contacts
<team-contacts
container-id=
"member-selector"
:leader=
"leaders"
:radio=
"true"
:radio=
"true"
:multiple=
"multiple"
:multiple=
"multiple"
:checked
.
sync=
"checkedMember"
:checked
.
sync=
"checkedMember"
...
@@ -114,7 +116,8 @@ export default Vue.extend({
...
@@ -114,7 +116,8 @@ export default Vue.extend({
// checkedMember: [],
// checkedMember: [],
showRadio
:
true
,
showRadio
:
true
,
changed
:
false
,
changed
:
false
,
changedVal
changedVal
,
leaders
:
{}
as
{
list
:
Staff
[],
title
?:
string
},
}
}
},
},
mounted
()
{
mounted
()
{
...
@@ -196,11 +199,10 @@ export default Vue.extend({
...
@@ -196,11 +199,10 @@ export default Vue.extend({
this
.
loading
=
false
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
currentDep
=
data
.
data
.
dep
this
.
currentDep
=
data
.
data
.
dep
// 通讯录
// 负责人/管理员
this
.
contacts
=
data
.
data
.
staffList
||
[]
this
.
leaders
.
list
=
data
.
data
.
staffList
.
filter
((
i
:
Staff
)
=>
i
.
role
!==
3
)
if
(
typeof
data
.
data
.
leader
!==
'undefined'
)
{
// 普通成员
this
.
contacts
.
push
(
data
.
data
.
leader
)
this
.
contacts
=
data
.
data
.
staffList
.
filter
((
i
:
Staff
)
=>
i
.
role
===
3
)
}
// 部门树
// 部门树
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 @
9633375d
...
@@ -13,18 +13,18 @@
...
@@ -13,18 +13,18 @@
{{
nav
}}
{{
nav
}}
</div>
</div>
</div>
</div>
<template
v-if=
"Object.keys(list).length > 0 || leader
s
.length > 0"
>
<template
v-if=
"Object.keys(list).length > 0 || leader
.list && leader.list
.length > 0"
>
<!-- 主管负责人 -->
<!-- 主管负责人 -->
<div
class=
"leaders"
v-if=
"leader
s
.length > 0"
>
<div
class=
"leaders"
v-if=
"leader
.list
.length > 0"
>
<div
<div
v-for=
"(l
eader, index) in leaders
"
v-for=
"(l
, index) in leader.list
"
:key=
"index"
:key=
"index"
class=
"flex items-center color-color-primary font-normal"
class=
"flex items-center color-color-primary font-normal"
>
>
<!-- 设置radio -->
<!-- 设置radio -->
<template
v-if=
"radio"
>
<template
v-if=
"radio"
>
<div
class=
"w-8 h-8 flex items-center justify-start"
@
click=
"handleCheck(l
eader
)"
>
<div
class=
"w-8 h-8 flex items-center justify-start"
@
click=
"handleCheck(l)"
>
<template
v-if=
"checked.indexOf(l
eader
.id) > -1"
>
<template
v-if=
"checked.indexOf(l.id) > -1"
>
<app-icon
<app-icon
type=
"png"
type=
"png"
icon-name=
"radio-checked"
icon-name=
"radio-checked"
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
</
template
>
</
template
>
</div>
</div>
</template>
</template>
<contact-member
:member=
"l
eader"
@
click=
"clickMember"
/>
<contact-member
:member=
"l
"
@
click=
"clickMember"
:title=
"leader.title"
/>
</div>
</div>
</div>
</div>
<!-- 成员 -->
<!-- 成员 -->
...
@@ -98,8 +98,14 @@ import { getContacts, getLeaders, uniqueArr } from '@/util/Contact'
...
@@ -98,8 +98,14 @@ import { getContacts, getLeaders, uniqueArr } from '@/util/Contact'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
props
:
{
props
:
{
leader
:
{
type
:
Object
,
default
(){
return
{}
}
},
contactList
:
{
contactList
:
{
type
:
Array
as
PropType
<
Array
<
Staff
>
>
,
type
:
Array
as
PropType
<
Staff
[]
>
,
default
()
{
default
()
{
return
[]
return
[]
}
}
...
@@ -117,7 +123,8 @@ export default Vue.extend({
...
@@ -117,7 +123,8 @@ export default Vue.extend({
multiple
:
{
multiple
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
}
},
containerId
:
String
},
},
components
:{
components
:{
'app-icon'
:()
=>
import
(
'@/components/common/Icon.vue'
),
'app-icon'
:()
=>
import
(
'@/components/common/Icon.vue'
),
...
@@ -132,20 +139,32 @@ export default Vue.extend({
...
@@ -132,20 +139,32 @@ export default Vue.extend({
}
}
},
},
mounted
()
{
mounted
()
{
window
.
addEventListener
(
'scroll'
,
this
.
scrollHandler
)
if
(
typeof
this
.
containerId
!==
'undefined'
)
{
this
.
container
.
addEventListener
(
'scroll'
,
this
.
scrollHandler
)
}
else
{
window
.
addEventListener
(
'scroll'
,
this
.
scrollHandler
)
}
},
},
beforeDestroy
()
{
beforeDestroy
()
{
window
.
removeEventListener
(
'scroll'
,
this
.
scrollHandler
)
if
(
typeof
this
.
containerId
!==
'undefined'
)
{
this
.
container
.
removeEventListener
(
'scroll'
,
this
.
scrollHandler
)
}
else
{
window
.
removeEventListener
(
'scroll'
,
this
.
scrollHandler
)
}
},
},
computed
:
{
computed
:
{
leaders
()
{
container
():
HTMLElement
{
return
getLeaders
(
uniqueArr
(
this
.
contactList
))
if
(
typeof
this
.
containerId
!==
'undefined'
&&
this
.
containerId
!==
''
)
{
return
document
.
getElementById
(
this
.
containerId
)
as
HTMLDivElement
}
else
{
return
document
.
documentElement
}
},
},
filteredContacts
()
{
filteredContacts
()
:{[
key
:
string
]:
Staff
[]}
{
return
getContacts
(
uniqueArr
(
this
.
contactList
).
filter
((
staff
:
Staff
)
=>
staff
.
role
===
Role
.
COMMON_MEMBER
)
||
[]
)
return
getContacts
(
this
.
contactList
.
filter
((
c
:
Staff
)
=>
this
.
leader
.
list
.
findIndex
((
l
:
Staff
)
=>
l
.
id
===
c
.
id
)
<
0
)
)
},
},
navs
()
{
navs
()
:
string
[]
{
let
arr
:
Array
<
string
>
=
[]
let
arr
=
[]
for
(
let
key
in
this
.
filteredContacts
)
{
for
(
let
key
in
this
.
filteredContacts
)
{
if
(
key
!==
'#'
){
if
(
key
!==
'#'
){
arr
.
push
(
key
)
arr
.
push
(
key
)
...
@@ -172,8 +191,8 @@ export default Vue.extend({
...
@@ -172,8 +191,8 @@ export default Vue.extend({
}
}
}
}
},
},
scrollHandler
()
{
scrollHandler
()
{
const
top
=
document
.
documentElement
.
scrollTop
const
top
=
this
.
container
.
scrollTop
this
.
scrollTop
=
top
this
.
scrollTop
=
top
this
.
navs
.
forEach
(
nav
=>
{
this
.
navs
.
forEach
(
nav
=>
{
if
((
this
.
$refs
[
nav
]
as
Array
<
HTMLDivElement
>
).
length
>
0
)
{
if
((
this
.
$refs
[
nav
]
as
Array
<
HTMLDivElement
>
).
length
>
0
)
{
...
@@ -188,7 +207,7 @@ export default Vue.extend({
...
@@ -188,7 +207,7 @@ export default Vue.extend({
this
.
currentNav
=
nav
this
.
currentNav
=
nav
const
div
=
(
this
.
$refs
[
nav
]
as
Array
<
HTMLDivElement
>
)[
0
]
const
div
=
(
this
.
$refs
[
nav
]
as
Array
<
HTMLDivElement
>
)[
0
]
const
top
=
div
.
getBoundingClientRect
().
top
const
top
=
div
.
getBoundingClientRect
().
top
document
.
documentElement
.
scrollTop
=
this
.
scrollTop
+
top
-
48
this
.
container
.
scrollTop
=
this
.
scrollTop
+
top
-
48
},
},
clickMember
(
member
:
Staff
)
{
clickMember
(
member
:
Staff
)
{
if
(
this
.
radio
)
{
if
(
this
.
radio
)
{
...
...
src/views/team/department-management.vue
View file @
9633375d
...
@@ -6,12 +6,14 @@
...
@@ -6,12 +6,14 @@
@
click-left=
"$router.go(-1)"
@
click-left=
"$router.go(-1)"
>
>
<member-selector
<member-selector
:show-team=
"true"
:title=
"memberSelectorTitle"
:title=
"memberSelectorTitle"
:show
.
sync=
"showMemberSelector"
:show
.
sync=
"showMemberSelector"
:multiple=
"multiple"
:multiple=
"multiple"
:checked-member-id
.
sync=
"selectedMemberId"
:checked-member-id
.
sync=
"selectedMemberId"
/>
/>
<contact-selector
<contact-selector
:contact-title=
"contactTitle"
:ent-id=
"entId"
:ent-id=
"entId"
:dep=
"depInfo"
:dep=
"depInfo"
:title=
"contactSelectorTitle"
:title=
"contactSelectorTitle"
...
@@ -19,7 +21,7 @@
...
@@ -19,7 +21,7 @@
:multiple=
"multiple"
:multiple=
"multiple"
:action-type=
"actionType"
:action-type=
"actionType"
:contacts=
"contacts"
:contacts=
"contacts"
:leader
s=
"leaders
"
:leader
=
"leader
"
/>
/>
<div
class=
"pt-14 px-4"
>
<div
class=
"pt-14 px-4"
>
<input-cell
<input-cell
...
@@ -106,11 +108,12 @@ export default Vue.extend({
...
@@ -106,11 +108,12 @@ export default Vue.extend({
multiple
:
false
,
multiple
:
false
,
contacts
:
[]
as
Array
<
Staff
>
,
contacts
:
[]
as
Array
<
Staff
>
,
leader
s
:
[]
as
Array
<
Staff
>
,
leader
:
{}
as
{
list
:
Staff
[],
title
?:
string
}
,
showContactSelector
:
false
,
showContactSelector
:
false
,
contactSelectorTitle
:
''
,
contactSelectorTitle
:
''
,
actionType
:
'add'
,
actionType
:
'add'
,
parentDepName
:
''
parentDepName
:
''
,
contactTitle
:
''
}
}
},
},
async
created
()
{
async
created
()
{
...
@@ -172,10 +175,14 @@ export default Vue.extend({
...
@@ -172,10 +175,14 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
// 通讯录
// 通讯录
this
.
contacts
=
data
.
data
.
staffList
||
[]
this
.
contacts
=
data
.
data
.
staffList
||
[]
if
(
typeof
data
.
data
.
leader
!==
'undefined'
)
{
if
(
this
.
actionType
===
'add'
)
{
this
.
contacts
.
push
(
data
.
data
.
leader
)
this
.
leader
.
list
=
data
.
data
.
staffList
.
filter
((
i
:
Staff
)
=>
i
.
role
!==
3
)
this
.
leader
.
title
=
''
this
.
contactTitle
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
as
string
).
name
}
else
{
this
.
leader
.
list
=
typeof
data
.
data
.
leader
===
'undefined'
?
[]
:
[
data
.
data
.
leader
]
this
.
leader
.
title
=
'主管'
}
}
// 部门树
}
else
{
}
else
{
this
.
$toast
(
data
.
msg
)
this
.
$toast
(
data
.
msg
)
}
}
...
...
src/views/team/team-frame.vue
View file @
9633375d
...
@@ -34,17 +34,18 @@
...
@@ -34,17 +34,18 @@
<div
class=
"pb-16"
>
<div
class=
"pb-16"
>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<team-contacts
<team-contacts
:leader=
"leaders"
:checked
.
sync=
"checkedMemberId"
:checked
.
sync=
"checkedMemberId"
:contact-list=
"co
ntacts
"
:contact-list=
"co
mmonMember
"
@
click-member=
"clickMember"
@
click-member=
"clickMember"
/>
/>
</div>
</div>
<!-- 底部操作 -->
<!-- 底部操作 -->
<div
class=
"py-2 px-4 bg-white w-screen fixed bottom-0 left-0 z-30"
v-if=
"
role !=3
"
>
<div
class=
"py-2 px-4 bg-white w-screen fixed bottom-0 left-0 z-30"
v-if=
"
showBottomBtn
"
>
<div
class=
"grid gap-2.5"
:class=
"
currentDep.parentId !== '-1'
? 'grid-cols-3' : 'grid-cols-2'"
>
<div
class=
"grid gap-2.5"
:class=
"
isNotDepRoot
? 'grid-cols-3' : 'grid-cols-2'"
>
<c-button
round
@
click=
"addMember"
>
添加成员
</c-button>
<c-button
round
@
click=
"addMember"
>
添加成员
</c-button>
<c-button
round
@
click=
"addDep"
>
添加部门
</c-button>
<c-button
round
@
click=
"addDep"
>
添加部门
</c-button>
<c-button
round
@
click=
"setDepartment"
v-if=
"
currentDep.parentId !== '-1'
"
>
部门设置
</c-button>
<c-button
round
@
click=
"setDepartment"
v-if=
"
isNotDepRoot
"
>
部门设置
</c-button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -54,9 +55,9 @@
...
@@ -54,9 +55,9 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
appNavBack
,
getUserInfo
,
goBack
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
appNavBack
,
getUserInfo
,
goBack
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
Department
,
LocalStoreUsr
,
Staff
}
from
'@/Interface'
import
{
Role
}
from
'@/service/moudles/service.dto'
// import {openCompanyUserInfo} from '@/util/Bridge'
// import {openCompanyUserInfo} from '@/util/Bridge'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
...
@@ -69,11 +70,6 @@ export default Vue.extend({
...
@@ -69,11 +70,6 @@ export default Vue.extend({
'c-button'
:
()
=>
import
(
'@/components/common/c-button.vue'
),
'c-button'
:
()
=>
import
(
'@/components/common/c-button.vue'
),
'switch-cell'
:
()
=>
import
(
'@/components/common/switch-cell.vue'
)
'switch-cell'
:
()
=>
import
(
'@/components/common/switch-cell.vue'
)
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
next
((
vm
:
any
)
=>
{
vm
.
fromPath
=
from
.
path
})
},
data
()
{
data
()
{
const
team
:
Department
[]
=
[]
const
team
:
Department
[]
=
[]
const
currentDep
:
Department
=
{
const
currentDep
:
Department
=
{
...
@@ -96,32 +92,29 @@ export default Vue.extend({
...
@@ -96,32 +92,29 @@ export default Vue.extend({
preDep
:
{},
preDep
:
{},
// 是否显示check
// 是否显示check
checkedMemberId
:
[],
checkedMemberId
:
[],
fromPath
:
''
,
role
:
3
,
role
:
null
leaders
:
{}
as
{
list
:
Staff
[],
title
?:
string
},
commonMember
:
[]
as
Staff
[]
}
}
},
},
async
mounted
()
{
async
mounted
()
{
const
res
=
JSON
.
parse
(
getUserInfo
()
||
"{}"
)
this
.
role
=
process
.
env
.
NODE_ENV
===
'production'
&&
res
.
role
this
.
entId
=
process
.
env
.
NODE_ENV
===
'production'
?
res
.
entId
:
'168398222891421696'
localStorage
.
setItem
(
'USR_INFO'
,
getUserInfo
())
localStorage
.
setItem
(
'USR_INFO'
,
getUserInfo
())
console
.
log
(
this
.
role
,
this
.
entId
,
'sdflokjsdklfjsdlkflsdjklfjsd;lkfjksld'
);
const
usrInfo
=
JSON
.
parse
(
getUserInfo
()
||
"{}"
)
this
.
role
=
usrInfo
.
role
<<<<<<<
HEAD
this
.
entId
=
process
.
env
.
NODE_ENV
===
'production'
?
usrInfo
.
entId
:
'168398222891421696'
await
this
.
getEntInfo
()
=======
this
.
entId
=
process
.
env
.
NODE_ENV
===
'production'
?
res
.
entId
:
'168398222891421696'
console
.
log
(
'这里出来了么?'
,
this
.
entId
,
getUserInfo
(),
'这里呢'
);
localStorage
.
setItem
(
'USR_INFO'
,
JSON
.
stringify
(
getUserInfo
()))
this
.
getEntInfo
()
this
.
getEntInfo
()
>>>>>>>
12282
a6f1686f9876c0e8110a24cada261c108f6
},
},
computed
:
{
computed
:
{
isDepDetail
():
boolean
{
isDepDetail
():
boolean
{
return
this
.
currentDep
.
parentId
!==
'-1'
return
this
.
currentDep
.
parentId
!==
'-1'
},
},
isNotDepRoot
():
boolean
{
return
this
.
currentDep
.
parentId
!==
'-1'
},
showBottomBtn
():
boolean
{
if
(
process
.
env
.
NODE_ENV
===
'development'
)
return
true
return
this
.
role
===
Role
.
SUPER_ADMIN
||
this
.
role
===
Role
.
LEADER
}
},
},
methods
:
{
methods
:
{
goPre
(
dep
:
Department
)
{
goPre
(
dep
:
Department
)
{
...
@@ -176,9 +169,16 @@ export default Vue.extend({
...
@@ -176,9 +169,16 @@ export default Vue.extend({
this
.
currentDep
=
data
.
data
.
dep
this
.
currentDep
=
data
.
data
.
dep
// 通讯录
// 通讯录
this
.
contacts
=
data
.
data
.
staffList
||
[]
this
.
contacts
=
data
.
data
.
staffList
||
[]
if
(
typeof
data
.
data
.
leader
!==
'undefined'
)
{
// 负责人/管理员
this
.
contacts
.
push
(
data
.
data
.
leader
)
if
(
this
.
isNotDepRoot
)
{
this
.
leaders
.
list
=
typeof
data
.
data
.
leader
===
'undefined'
?
[]
:
[
data
.
data
.
leader
]
this
.
leaders
.
title
=
'主管'
}
else
{
this
.
leaders
.
list
=
data
.
data
.
staffList
.
filter
((
i
:
Staff
)
=>
i
.
role
!==
3
)
this
.
leaders
.
title
=
''
}
}
// 普通成员
this
.
commonMember
=
data
.
data
.
staffList
.
filter
((
i
:
Staff
)
=>
i
.
role
===
3
)
// 部门树
// 部门树
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