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
8644deb3
Commit
8644deb3
authored
Sep 08, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of gitlab.33.cn:HF_web/OKR
parents
2ccb8ac3
7478d2e5
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
81 additions
and
48 deletions
+81
-48
service.dto.ts
src/service/moudles/service.dto.ts
+4
-3
index.ts
src/util/Bridge/index.ts
+15
-4
index.ts
src/util/Contact/index.ts
+6
-0
add-member.vue
src/views/team/add-member.vue
+4
-4
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
+13
-13
department-management.vue
src/views/team/department-management.vue
+6
-4
confirm-join.vue
src/views/team/join-team/confirm-join.vue
+1
-1
team-detail.vue
src/views/team/team-detail.vue
+8
-2
team-frame.vue
src/views/team/team-frame.vue
+12
-10
two-code.vue
src/views/team/two-code.vue
+2
-2
No files found.
src/service/moudles/service.dto.ts
View file @
8644deb3
export
enum
Role
{
TEAM_LE
DER
=
0
,
LEA
DER
=
0
,
SUPER_ADMIN
=
1
,
CLIENT_MANAGER
=
2
,
COMMOM_MEMBER
=
3
CUSTOMER_ADMIN
=
2
,
COMMON_MEMBER
=
3
,
CHILD_ADMIN
=
4
,
}
export
enum
Apply
{
...
...
src/util/Bridge/index.ts
View file @
8644deb3
...
...
@@ -7,7 +7,15 @@ import router from '@/router';
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
dsbridge
from
'dsbridge'
interface
GETUSERINFO
{
export
enum
RoleType
{
LEADER
=
0
,
SUPER_ADMIN
=
1
,
CUSTOMER_ADMIN
=
2
,
COMMON_MEMBER
=
3
,
CHILD_ADMIN
=
4
,
}
export
interface
GETUSERINFO
{
"company"
:
any
,
"depId"
:
string
,
...
...
@@ -17,7 +25,7 @@ interface GETUSERINFO{
"name"
:
string
,
"phone"
:
string
,
"position"
:
string
,
"role"
:
number
"role"
:
RoleType
}
...
...
@@ -42,8 +50,9 @@ export function isAppEnv() {
}
export
function
appNavBack
(){
console
.
log
(
111
);
const
appEnv
=
isAppEnv
()
console
.
log
(
111
);
if
(
appEnv
){
goBack
()
...
...
@@ -57,7 +66,7 @@ export function appNavBack(){
* 获取用户的资料
* @returns
*/
export
function
getUserInfo
():
GETUSERINFO
{
export
function
getUserInfo
():
any
{
const
data
=
dsbridge
.
call
(
BridgeMethods
.
GET_USERINFO
,
{},
(
res
)
=>
{
return
res
})
...
...
@@ -127,6 +136,8 @@ export function getSign(obj: object) {
export
function
getPublicKey
(){
const
data
=
dsbridge
.
call
(
BridgeMethods
.
GET_PUBLIC_KEY
,{},
res
=>
{
console
.
log
(
res
);
return
res
})
return
data
...
...
src/util/Contact/index.ts
View file @
8644deb3
...
...
@@ -2,6 +2,7 @@ import Mock from 'mockjs'
import
{
strChineseFirstPY
}
from
'./strChineseFirstPY'
import
{
oMultiDiff
}
from
'./oMultiDiff'
import
{
Staff
}
from
'@/Interface'
import
{
Role
}
from
'@/service/moudles/service.dto'
// 参数,中文字符串
// 返回值:拼音首字母串数组
...
...
@@ -108,3 +109,8 @@ export function getContacts(arr: Array<Staff>) {
})
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/add-member.vue
View file @
8644deb3
...
...
@@ -52,7 +52,7 @@
dot
required
title=
"入职时间"
:content=
"formatDate(acceptJoin.joinTime || new Date().getTime(), 'YYYY-MM-DD')"
:content=
"formatDate(acceptJoin.joinTime
*1000
|| new Date().getTime(), 'YYYY-MM-DD')"
@
click=
"show = true"
/>
<van-calendar
...
...
@@ -122,7 +122,7 @@ export default Vue.extend({
depId
:
''
,
entId
:
''
,
hash
:
''
,
joinTime
:
new
Date
().
getTime
(
),
joinTime
:
Math
.
round
(
new
Date
().
getTime
()
/
1000
),
phone
:
''
,
position
:
''
}
...
...
@@ -200,7 +200,7 @@ export default Vue.extend({
},
// 入职日期
selectJoinTime
(
date
:
Date
)
{
this
.
acceptJoin
.
joinTime
=
new
Date
(
date
).
getTime
(
)
this
.
acceptJoin
.
joinTime
=
Math
.
round
(
new
Date
(
date
).
getTime
()
/
1000
)
this
.
show
=
false
this
.
date
=
this
.
formatDate
(
date
)
},
...
...
@@ -215,7 +215,7 @@ export default Vue.extend({
}).
then
(()
=>
{
this
.
acceptJoin
.
entId
=
this
.
entId
this
.
acceptJoin
.
depId
=
this
.
selectedDepId
this
.
acceptJoin
.
expiration
=
this
.
acceptJoin
.
joinTime
+
600000
0
this
.
acceptJoin
.
expiration
=
Math
.
round
(
new
Date
().
getTime
()
/
1000
)
+
24
*
60
*
6
0
this
.
acceptJoin
.
inviterId
=
process
.
env
.
NODE_ENV
===
'production'
?
getPublicKey
():
"1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR"
this
.
acceptJoin
.
oaServer
=
localStorage
.
getItem
(
'ENT_INFO'
)?
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
as
any
).
oaServer
:
'http://172.16.101.107:20000'
const
{
depId
,
entId
,
expiration
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
}
=
this
.
acceptJoin
...
...
src/views/team/components/contact-selector.vue
View file @
8644deb3
...
...
@@ -20,7 +20,7 @@
:radio=
"true"
:multiple=
"multiple"
:checked
.
sync=
"checkedMember"
:contact
s
=
"contacts"
:contact
-list
=
"contacts"
/>
</div>
<!-- 底部操作 -->
...
...
@@ -62,7 +62,12 @@ export default Vue.extend({
type
:
String
,
default
:
'团队成员'
},
contacts
:
Object
,
contacts
:
{
type
:
Array
,
default
()
{
return
[]
}
},
actionType
:
String
},
data
()
{
...
...
src/views/team/components/member-selector.vue
View file @
8644deb3
...
...
@@ -41,7 +41,7 @@
:radio=
"true"
:multiple=
"multiple"
:checked
.
sync=
"checkedMember"
:contact
s
=
"contacts"
:contact
-list
=
"contacts"
/>
</div>
<!-- 底部操作 -->
...
...
@@ -103,7 +103,7 @@ export default Vue.extend({
return
{
team
,
loading
:
false
,
contacts
:
{}
,
contacts
:
[]
as
Array
<
Staff
>
,
parentId
:
''
,
entId
:
''
,
ifContainChildDep
:
false
,
...
...
@@ -197,7 +197,7 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
currentDep
=
data
.
data
.
dep
// 通讯录
this
.
contacts
=
getContacts
(
data
.
data
.
staffList
||
[])
this
.
contacts
=
data
.
data
.
staffList
||
[]
// 部门树
const
depTree
=
data
.
data
.
dep
depTree
.
children
=
data
.
data
.
subDepList
...
...
src/views/team/components/team-contacts.vue
View file @
8644deb3
...
...
@@ -13,9 +13,9 @@
{{
nav
}}
</div>
</div>
<template
v-if=
"Object.keys(list).length > 0"
>
<template
v-if=
"Object.keys(list).length > 0
|| leaders.length > 0
"
>
<!-- 主管负责人 -->
<div
class=
"leaders"
>
<div
class=
"leaders"
v-if=
"leaders.length > 0"
>
<div
v-for=
"(leader, index) in leaders"
:key=
"index"
...
...
@@ -91,16 +91,17 @@
</template>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
,
{
PropType
}
from
'vue'
import
{
Staff
,
Contacts
}
from
'@/Interface'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
getContacts
,
getLeaders
}
from
'@/util/Contact'
export
default
Vue
.
extend
({
props
:
{
contact
s
:
{
type
:
Object
,
contact
List
:
{
type
:
Array
as
PropType
<
Array
<
Staff
>>
,
default
()
{
return
{}
return
[]
}
},
radio
:
{
...
...
@@ -138,15 +139,14 @@ export default Vue.extend({
},
computed
:
{
leaders
()
{
let
arr
:
Array
<
Staff
>
=
[]
for
(
const
key
in
this
.
contacts
)
{
arr
=
arr
.
concat
(
this
.
contacts
[
key
])
}
return
arr
.
filter
(
item
=>
item
.
role
===
Role
.
TEAM_LEDER
||
item
.
role
===
Role
.
SUPER_ADMIN
).
sort
((
a
,
b
)
=>
b
.
role
-
a
.
role
)
return
getLeaders
(
this
.
contactList
)
},
filteredContacts
()
{
return
getContacts
(
this
.
contactList
.
filter
((
staff
:
Staff
)
=>
staff
.
role
===
Role
.
COMMON_MEMBER
)
||
[])
},
navs
()
{
let
arr
:
Array
<
string
>
=
[]
for
(
let
key
in
this
.
c
ontacts
)
{
for
(
let
key
in
this
.
filteredC
ontacts
)
{
if
(
key
!==
'#'
){
arr
.
push
(
key
)
}
else
{
...
...
@@ -158,7 +158,7 @@ export default Vue.extend({
list
()
{
const
obj
:
Contacts
=
{}
this
.
navs
.
forEach
(
nav
=>
{
obj
[
nav
]
=
this
.
c
ontacts
[
nav
]
obj
[
nav
]
=
this
.
filteredC
ontacts
[
nav
]
})
return
obj
}
...
...
src/views/team/department-management.vue
View file @
8644deb3
...
...
@@ -19,6 +19,7 @@
:multiple=
"multiple"
:action-type=
"actionType"
:contacts=
"contacts"
:leaders=
"leaders"
/>
<div
class=
"pt-14 px-4"
>
<input-cell
...
...
@@ -75,7 +76,7 @@
<
script
lang=
"ts"
>
import
{
Department
,
Staff
}
from
'@/Interface'
import
Vue
from
'vue'
import
{
getContacts
}
from
'@/util/Contact'
import
{
getContacts
,
getLeaders
}
from
'@/util/Contact'
export
default
Vue
.
extend
({
name
:
'DepartmentManagement'
,
...
...
@@ -105,7 +106,8 @@ export default Vue.extend({
memberSelectorTitle
:
''
,
multiple
:
false
,
contacts
:
{},
contacts
:
[],
leaders
:
[]
as
Array
<
Staff
>
,
showContactSelector
:
false
,
contactSelectorTitle
:
''
,
actionType
:
'add'
...
...
@@ -162,8 +164,8 @@ export default Vue.extend({
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
// 通讯录
this
.
contacts
=
getContacts
(
data
.
data
.
staffList
||
[]
)
console
.
log
(
this
.
contacts
,
data
.
data
.
staffList
,
'this.contacts'
)
console
.
log
(
data
.
data
.
staffList
,
'lll'
)
this
.
contacts
=
data
.
data
.
staffList
||
[]
// 部门树
}
else
{
this
.
$toast
(
data
.
msg
)
...
...
src/views/team/join-team/confirm-join.vue
View file @
8644deb3
...
...
@@ -121,7 +121,7 @@ export default Vue.extend({
this
.
loading
=
true
const
{
depId
,
entId
,
expiration
,
hash
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
}
=
this
.
info
as
AcceptJoinDTO
let
req
=
{
depId
,
entId
,
expiration
:
Number
(
expiration
)
/
1000
,
hash
,
inviterId
,
joinTime
:
Number
(
joinTime
)
/
1000
,
name
,
oaServer
,
phone
,
position
depId
,
entId
,
expiration
:
Number
(
expiration
)
,
hash
,
inviterId
,
joinTime
:
Number
(
joinTime
)
,
name
,
oaServer
,
phone
,
position
}
this
.
$service
.
enterprise
.
acceptJoin
(
req
)
.
then
((
res
:
any
)
=>
{
...
...
src/views/team/team-detail.vue
View file @
8644deb3
...
...
@@ -43,7 +43,7 @@
<c-button
round
@
click=
"$router.push('/team/team-management')"
>
确定
</c-button>
</
template
>
<
template
v-else
>
<div
class=
"grid grid-cols-3 gap-2.5"
>
<div
class=
"grid grid-cols-3 gap-2.5"
v-if=
"getUserInfo.role === 3"
>
<c-button
round
@
click=
"$router.push('/team/add-member')"
>
添加成员
</c-button>
<c-button
round
@
click=
"$router.push('/team/add-department')"
>
添加部门
</c-button>
<c-button
round
@
click=
"setDepartment"
>
部门设置
</c-button>
...
...
@@ -59,7 +59,7 @@ import Vue from 'vue'
import
{
team
,
contacts
}
from
'@/DTO'
import
{
Member
}
from
'@/DTO'
import
{
getContacts
}
from
'@/util/Contact'
import
{
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
openCompanyUserInfo
,
appNavBack
,
getUserInfo
}
from
'@/util/Bridge'
export
default
Vue
.
extend
({
name
:
'TeamDetail'
,
...
...
@@ -101,6 +101,11 @@ export default Vue.extend({
immediate
:
false
}
},
computed
:{
getUserInfo
(){
return
JSON
.
parse
(
getUserInfo
())
}
},
created
()
{
this
.
showRadio
=
this
.
$route
.
query
.
showRadio
===
'1'
this
.
multiple
=
this
.
$route
.
query
.
multiple
===
'2'
...
...
@@ -109,6 +114,7 @@ export default Vue.extend({
this
.
getStaff
(
this
.
parentId
)
},
methods
:
{
appNavBack
,
// 获取成员
getStaff
(
id
:
string
)
{
this
.
loading
=
true
...
...
src/views/team/team-frame.vue
View file @
8644deb3
...
...
@@ -35,7 +35,7 @@
<div
class=
"text-text-secondary py-1"
>
成员
</div>
<team-contacts
:checked
.
sync=
"checkedMemberId"
:contact
s
=
"contacts"
:contact
-list
=
"contacts"
@
click-member=
"clickMember"
/>
</div>
...
...
@@ -56,7 +56,6 @@
import
Vue
from
'vue'
import
{
useLocalStorageState
}
from
'ahooks-vue'
import
{
appNavBack
,
getUserInfo
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
getContacts
}
from
'@/util/Contact'
import
{
Department
,
Staff
}
from
'@/Interface'
// import {openCompanyUserInfo} from '@/util/Bridge'
...
...
@@ -88,7 +87,7 @@ export default Vue.extend({
title
:
'导航'
,
team
,
loading
:
false
,
contacts
:
{}
,
contacts
:
[]
as
Array
<
Staff
>
,
parentId
:
''
,
entId
:
''
,
ifContainChildDep
:
true
,
...
...
@@ -101,7 +100,12 @@ export default Vue.extend({
}
},
mounted
()
{
this
.
entId
=
getUserInfo
()?.
entId
||
'166961152260050944'
const
res
=
JSON
.
parse
(
getUserInfo
()
||
"{}"
)
console
.
log
(
res
,
typeof
res
,
'哈哈哈'
);
this
.
entId
=
process
.
env
.
NODE_ENV
===
'production'
?
res
.
entId
:
'166961152260050944'
console
.
log
(
'这里出来了么?'
,
this
.
entId
,
getUserInfo
(),
'这里呢'
);
localStorage
.
setItem
(
'USR_INFO'
,
JSON
.
stringify
(
getUserInfo
()))
this
.
getEntInfo
()
},
...
...
@@ -115,14 +119,12 @@ export default Vue.extend({
this
.
parentId
=
dep
.
id
this
.
getStaff
()
},
appNavBack
(){
// this.$router.go(-1)
appNavBack
()
},
appNavBack
,
getEntInfo
()
{
this
.
loading
=
true
return
this
.
$service
.
enterprise
.
getEnterpriseInfo
({
id
:
this
.
entId
id
:
this
.
entId
}).
then
((
res
:
any
)
=>
{
const
{
data
}
=
res
this
.
loading
=
false
...
...
@@ -165,7 +167,7 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
currentDep
=
data
.
data
.
dep
// 通讯录
this
.
contacts
=
getContacts
(
data
.
data
.
staffList
||
[])
this
.
contacts
=
data
.
data
.
staffList
// 部门树
const
depTree
=
data
.
data
.
dep
depTree
.
children
=
data
.
data
.
subDepList
...
...
src/views/team/two-code.vue
View file @
8644deb3
...
...
@@ -103,8 +103,9 @@ export default Vue.extend({
async
created
()
{
// console.log(Mock, 'mock')
this
.
joinInfo
=
this
.
$store
.
state
.
acceptJoin
cons
t
urloutput
=
this
.
outputUrl
(
this
.
joinInfo
)
cons
ole
.
log
(
this
.
joinInfo
);
const
urloutput
=
await
this
.
outputUrl
(
this
.
joinInfo
)
this
.
qrCodeText
=
JSON
.
stringify
(
this
.
joinInfo
)
let
url
=
window
.
location
.
origin
+
'/team/confirm-join'
this
.
qrCodeText
=
`
${
url
}
?
${
urloutput
}
`
...
...
@@ -128,7 +129,6 @@ export default Vue.extend({
}
else
{
string
=
`
${
i
[
0
]}
=
${
encodeURIComponent
(
i
[
1
])}
`
}
res
+=
string
})
...
...
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