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
7d26ad2e
Commit
7d26ad2e
authored
Sep 14, 2021
by
sixiaofeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
24852213
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
399 additions
and
114 deletions
+399
-114
index.ts
src/Interface/index.ts
+2
-1
input-cell.vue
src/components/common/input-cell.vue
+4
-1
index.ts
src/const/Global/index.ts
+2
-1
team.ts
src/router/team.ts
+1
-1
base.ts
src/service/base.ts
+6
-0
service.dto.ts
src/service/moudles/service.dto.ts
+1
-1
index.ts
src/util/Bridge/index.ts
+2
-1
add-department.vue
src/views/team/add-department.vue
+14
-3
add-member.vue
src/views/team/add-member.vue
+28
-10
auth-management.vue
src/views/team/auth-management.vue
+16
-20
avator-editor.vue
src/views/team/components/avator-editor.vue
+62
-14
contact-member.vue
src/views/team/components/contact-member.vue
+3
-0
member-selector.vue
src/views/team/components/member-selector.vue
+1
-1
confirm-join.vue
src/views/team/join-team/confirm-join.vue
+35
-12
team-frame.vue
src/views/team/team-frame.vue
+46
-13
team-info.vue
src/views/team/team-info/team-info.vue
+96
-18
team-management.vue
src/views/team/team-management.vue
+74
-12
two-code.vue
src/views/team/two-code.vue
+6
-5
No files found.
src/Interface/index.ts
View file @
7d26ad2e
...
@@ -14,7 +14,8 @@ export interface Staff {
...
@@ -14,7 +14,8 @@ export interface Staff {
"depName"
:
string
,
"depName"
:
string
,
"entName"
:
string
,
"entName"
:
string
,
"id"
:
string
,
"id"
:
string
,
"workplace"
:
string
"workplace"
:
string
,
"isActivated"
:
boolean
}
}
// 通讯录
// 通讯录
...
...
src/components/common/input-cell.vue
View file @
7d26ad2e
...
@@ -138,8 +138,11 @@ export default Vue.extend({
...
@@ -138,8 +138,11 @@ export default Vue.extend({
}
}
},
},
watch
:
{
watch
:
{
value
(
val
)
{
value
:
{
handler
(
val
)
{
this
.
length
=
val
.
length
this
.
length
=
val
.
length
},
immediate
:
true
}
}
}
}
})
})
...
...
src/const/Global/index.ts
View file @
7d26ad2e
export
const
global
=
{
export
const
global
=
{
success
:
0
success
:
0
,
sig
:
''
}
}
src/router/team.ts
View file @
7d26ad2e
...
@@ -41,7 +41,7 @@ export const teamRoutes: Array<RouteConfig> = [
...
@@ -41,7 +41,7 @@ export const teamRoutes: Array<RouteConfig> = [
name
:
'Team'
,
name
:
'Team'
,
component
:
()
=>
import
(
'@/views/team/team-frame.vue'
),
component
:
()
=>
import
(
'@/views/team/team-frame.vue'
),
meta
:
{
meta
:
{
title
:
'
团队
架构'
title
:
'
组织
架构'
}
}
},
},
{
{
...
...
src/service/base.ts
View file @
7d26ad2e
import
axios
,
{
AxiosInstance
}
from
"axios"
import
axios
,
{
AxiosInstance
}
from
"axios"
import
{
global
}
from
'@/const/Global'
import
router
from
'@/router'
import
router
from
'@/router'
...
@@ -12,6 +13,7 @@ export const Account = {
...
@@ -12,6 +13,7 @@ export const Account = {
entId
:
'166961152260050944'
,
entId
:
'166961152260050944'
,
staffId
:
'1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR'
staffId
:
'1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR'
}
}
interface
RouterConfig
{
interface
RouterConfig
{
path
:
string
path
:
string
method
?:
string
method
?:
string
...
@@ -27,6 +29,10 @@ export default class BaseService {
...
@@ -27,6 +29,10 @@ export default class BaseService {
})
})
this
.
service
.
interceptors
.
request
.
use
(
this
.
service
.
interceptors
.
request
.
use
(
(
res
)
=>
{
(
res
)
=>
{
if
(
global
.
sig
!==
''
)
{
// from pc
res
.
headers
[
'FZM-SIGNATURE'
]
=
global
.
sig
}
return
res
return
res
},
},
(
err
)
=>
{
(
err
)
=>
{
...
...
src/service/moudles/service.dto.ts
View file @
7d26ad2e
...
@@ -39,7 +39,7 @@ export interface DeleteEnterpriseDTO {
...
@@ -39,7 +39,7 @@ export interface DeleteEnterpriseDTO {
}
}
export
interface
updateEnterpriseDTO
{
export
interface
updateEnterpriseDTO
{
avat
o
r
:
string
,
avat
a
r
:
string
,
description
:
string
,
description
:
string
,
id
:
string
,
id
:
string
,
name
:
string
name
:
string
...
...
src/util/Bridge/index.ts
View file @
7d26ad2e
...
@@ -169,5 +169,6 @@ export default {
...
@@ -169,5 +169,6 @@ export default {
signAuth
,
signAuth
,
scanCode
,
scanCode
,
openCompanyUserInfo
,
openCompanyUserInfo
,
goBack
goBack
,
close
}
}
src/views/team/add-department.vue
View file @
7d26ad2e
...
@@ -48,7 +48,6 @@
...
@@ -48,7 +48,6 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
useRequest
}
from
'ahooks-vue'
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
AddSubDTO
}
from
'@/service/moudles/service.dto'
import
{
AddSubDTO
}
from
'@/service/moudles/service.dto'
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
Department
,
Staff
}
from
'@/Interface'
...
@@ -65,6 +64,12 @@ export default Vue.extend({
...
@@ -65,6 +64,12 @@ export default Vue.extend({
'dep-selector'
:
()
=>
import
(
'@/views/team/components/dep-selector.vue'
),
'dep-selector'
:
()
=>
import
(
'@/views/team/components/dep-selector.vue'
),
},
},
name
:
'AddDepartment'
,
name
:
'AddDepartment'
,
beforeRouteEnter
(
to
,
from
,
next
)
{
const
path
=
from
.
path
next
((
vm
:
any
)
=>
{
vm
.
fromManagement
=
path
===
'/team/team-management'
})
},
data
()
{
data
()
{
const
addDep
:
AddSubDTO
=
{
const
addDep
:
AddSubDTO
=
{
entId
:
''
,
entId
:
''
,
...
@@ -104,7 +109,8 @@ export default Vue.extend({
...
@@ -104,7 +109,8 @@ export default Vue.extend({
selectedDepId
:
''
,
selectedDepId
:
''
,
contacts
:
{},
contacts
:
{},
loading
:
false
,
loading
:
false
,
showDepSelector
:
false
showDepSelector
:
false
,
fromManagement
:
false
}
}
},
},
created
(){
created
(){
...
@@ -119,7 +125,12 @@ export default Vue.extend({
...
@@ -119,7 +125,12 @@ export default Vue.extend({
},
},
methods
:
{
methods
:
{
goBack
()
{
goBack
()
{
this
.
$router
.
replace
(
'/team/team-frame'
)
// this.$router.replace('/team/team-frame')
if
(
this
.
fromManagement
)
{
this
.
$router
.
push
(
'/team/team-management'
)
}
else
{
this
.
$router
.
push
(
'/team/team-frame'
)
}
},
},
addDepConfirm
(){
addDepConfirm
(){
if
(
this
.
name
===
''
)
{
if
(
this
.
name
===
''
)
{
...
...
src/views/team/add-member.vue
View file @
7d26ad2e
...
@@ -29,7 +29,6 @@
...
@@ -29,7 +29,6 @@
/>
/>
<input-cell
<input-cell
v-model=
"acceptJoin.position"
v-model=
"acceptJoin.position"
required
:limit=
"10"
:limit=
"10"
label=
"职位"
label=
"职位"
placeholder=
"请输入职位"
placeholder=
"请输入职位"
...
@@ -37,6 +36,7 @@
...
@@ -37,6 +36,7 @@
/>
/>
<!-- 手机号/员工编号/入职时间 -->
<!-- 手机号/员工编号/入职时间 -->
<c-cell
<c-cell
v-if=
"!isEdit"
v-model=
"acceptJoin.phone"
v-model=
"acceptJoin.phone"
required
required
title=
"手机号"
title=
"手机号"
...
@@ -47,6 +47,12 @@
...
@@ -47,6 +47,12 @@
:validator=
"checkPhone"
:validator=
"checkPhone"
/>
/>
<c-cell
<c-cell
v-else
title=
"手机号"
:content=
"acceptJoin.phone"
class=
"mt-4"
/>
<c-cell
v-model=
"acceptJoin.shortPhone"
v-model=
"acceptJoin.shortPhone"
title=
"短号"
title=
"短号"
placeholder=
"请输入短号"
placeholder=
"请输入短号"
...
@@ -55,7 +61,6 @@
...
@@ -55,7 +61,6 @@
<c-cell
<c-cell
v-model=
"date"
v-model=
"date"
dot
dot
required
title=
"入职时间"
title=
"入职时间"
:content=
"formatDate(acceptJoin.joinTime*1000 || new Date().getTime(), 'YYYY-MM-DD')"
:content=
"formatDate(acceptJoin.joinTime*1000 || new Date().getTime(), 'YYYY-MM-DD')"
@
click=
"show = true"
@
click=
"show = true"
...
@@ -69,10 +74,10 @@
...
@@ -69,10 +74,10 @@
@
confirm=
"selectJoinTime"
@
confirm=
"selectJoinTime"
/>
/>
<!-- 选择部门 -->
<!-- 选择部门 -->
<group-cell
required
class=
"mt-4"
title=
"所属部门"
@
click
.
native=
"selectDep"
>
<group-cell
class=
"mt-4"
title=
"所属部门"
@
click
.
native=
"selectDep"
>
<c-cell
dot
:title=
"currentDep.name"
/>
<c-cell
dot
:title=
"currentDep.name"
/>
</group-cell>
</group-cell>
<group-cell
class=
"mt-4"
title=
"绑定账户"
>
<group-cell
v-if=
"isEdit"
class=
"mt-4"
title=
"绑定账户"
>
<c-cell
<c-cell
v-model=
"usrId"
v-model=
"usrId"
class-input=
"text-left"
class-input=
"text-left"
...
@@ -116,6 +121,12 @@ export default Vue.extend({
...
@@ -116,6 +121,12 @@ export default Vue.extend({
'group-cell'
:
()
=>
import
(
'@/components/common/group-cell.vue'
),
'group-cell'
:
()
=>
import
(
'@/components/common/group-cell.vue'
),
'dep-selector'
:
()
=>
import
(
'@/views/team/components/dep-selector.vue'
)
'dep-selector'
:
()
=>
import
(
'@/views/team/components/dep-selector.vue'
)
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
const
path
=
from
.
path
next
((
vm
:
any
)
=>
{
vm
.
fromManagement
=
path
===
'/team/team-management'
})
},
data
()
{
data
()
{
const
currentDep
:
Department
=
{
const
currentDep
:
Department
=
{
entId
:
''
,
entId
:
''
,
...
@@ -160,7 +171,8 @@ export default Vue.extend({
...
@@ -160,7 +171,8 @@ export default Vue.extend({
pageTitle
:
'添加成员'
,
pageTitle
:
'添加成员'
,
isEdit
:
false
,
isEdit
:
false
,
usrId
:
''
,
usrId
:
''
,
shortPhone
:
''
shortPhone
:
''
,
fromManagement
:
false
}
}
},
},
async
created
()
{
async
created
()
{
...
@@ -171,6 +183,7 @@ export default Vue.extend({
...
@@ -171,6 +183,7 @@ export default Vue.extend({
this
.
pageTitle
=
'编辑成员'
this
.
pageTitle
=
'编辑成员'
this
.
usrId
=
query
.
usrId
this
.
usrId
=
query
.
usrId
const
usrInfo
=
await
this
.
getStaff
(
this
.
usrId
)
const
usrInfo
=
await
this
.
getStaff
(
this
.
usrId
)
console
.
log
(
usrInfo
,
'usrInfo'
)
this
.
selectedDepId
=
this
.
depId
=
usrInfo
.
depId
this
.
selectedDepId
=
this
.
depId
=
usrInfo
.
depId
this
.
entId
=
usrInfo
.
entId
this
.
entId
=
usrInfo
.
entId
this
.
date
=
this
.
formatDate
(
usrInfo
.
joinTime
)
this
.
date
=
this
.
formatDate
(
usrInfo
.
joinTime
)
...
@@ -179,7 +192,7 @@ export default Vue.extend({
...
@@ -179,7 +192,7 @@ export default Vue.extend({
// 添加
// 添加
const
entInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
)
const
entInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
||
'{}'
)
this
.
selectedDepId
=
this
.
depId
=
this
.
$route
.
query
.
id
as
string
||
entInfo
.
rootDepId
this
.
selectedDepId
=
this
.
depId
=
this
.
$route
.
query
.
id
as
string
||
entInfo
.
rootDepId
this
.
entId
=
entInfo
.
id
||
'168398222891421696'
this
.
entId
=
entInfo
.
id
this
.
date
=
this
.
formatDate
(
new
Date
())
this
.
date
=
this
.
formatDate
(
new
Date
())
this
.
pageTitle
=
'添加成员'
this
.
pageTitle
=
'添加成员'
}
}
...
@@ -189,7 +202,7 @@ export default Vue.extend({
...
@@ -189,7 +202,7 @@ export default Vue.extend({
methods
:
{
methods
:
{
validateParmas
():
boolean
{
validateParmas
():
boolean
{
const
{
phone
,
name
,
position
,
joinTime
}
=
this
.
acceptJoin
const
{
phone
,
name
,
position
,
joinTime
}
=
this
.
acceptJoin
return
!
this
.
validatePhone
(
phone
)
||
trim
(
name
)
===
''
||
trim
(
position
)
===
''
||
joinTime
===
0
||
trim
(
this
.
depId
)
===
''
return
!
this
.
validatePhone
(
phone
)
||
trim
(
name
)
===
''
},
},
getStaff
(
id
:
string
)
{
getStaff
(
id
:
string
)
{
this
.
loading
=
true
this
.
loading
=
true
...
@@ -308,7 +321,12 @@ export default Vue.extend({
...
@@ -308,7 +321,12 @@ export default Vue.extend({
}
}
},
},
handleClickLeft
()
{
handleClickLeft
()
{
this
.
$router
.
replace
(
'/team/team-frame'
)
// this.$router.replace('/team/team-frame')
if
(
this
.
fromManagement
)
{
this
.
$router
.
push
(
'/team/team-management'
)
}
else
{
this
.
$router
.
push
(
'/team/team-frame'
)
}
},
},
// 入职日期
// 入职日期
selectJoinTime
(
date
:
Date
)
{
selectJoinTime
(
date
:
Date
)
{
...
@@ -330,9 +348,9 @@ export default Vue.extend({
...
@@ -330,9 +348,9 @@ export default Vue.extend({
this
.
acceptJoin
.
expiration
=
Math
.
round
(
new
Date
().
getTime
()
/
1000
)
+
24
*
60
*
60
this
.
acceptJoin
.
expiration
=
Math
.
round
(
new
Date
().
getTime
()
/
1000
)
+
24
*
60
*
60
this
.
acceptJoin
.
inviterId
=
process
.
env
.
NODE_ENV
===
'production'
?
getPublicKey
():
"1FKxgaEh5fuSm7a35BfUnKYAmradowpiTR"
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'
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
const
{
depId
,
entId
,
expiration
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
,
shortPhone
}
=
this
.
acceptJoin
this
.
acceptJoin
.
hash
=
process
.
env
.
NODE_ENV
===
'production'
?
getSign
({
this
.
acceptJoin
.
hash
=
process
.
env
.
NODE_ENV
===
'production'
?
getSign
({
depId
,
entId
,
expiration
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
depId
,
entId
,
expiration
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
,
shortPhone
})
:
'mock-hash'
})
:
'mock-hash'
this
.
$store
.
commit
(
'setAcceptJoin'
,
this
.
acceptJoin
)
this
.
$store
.
commit
(
'setAcceptJoin'
,
this
.
acceptJoin
)
this
.
$router
.
push
(
'/team/two-code'
)
this
.
$router
.
push
(
'/team/two-code'
)
...
...
src/views/team/auth-management.vue
View file @
7d26ad2e
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
</div>
</div>
<!-- 负责人 -->
<!-- 负责人 -->
<div
class=
"text-xs text-text-secondary mt-4"
>
负责人
</div>
<div
class=
"text-xs text-text-secondary mt-4"
>
负责人
</div>
<div
v-if=
"leaderList.length > 0"
>
<div
<div
v-for=
"l in leaderList"
v-for=
"l in leaderList"
:key=
"l.id"
:key=
"l.id"
...
@@ -34,6 +35,10 @@
...
@@ -34,6 +35,10 @@
/>
/>
<div
class=
"name truncate ml-3"
>
{{
l
.
name
}}
</div>
<div
class=
"name truncate ml-3"
>
{{
l
.
name
}}
</div>
</div>
</div>
</div>
<div
v-else
>
暂无负责人
</div>
<!-- 管理员 -->
<!-- 管理员 -->
<div
class=
"text-xs text-text-secondary mt-2"
>
管理员
</div>
<div
class=
"text-xs text-text-secondary mt-2"
>
管理员
</div>
<!-- 没有管理员 -->
<!-- 没有管理员 -->
...
@@ -80,7 +85,6 @@
...
@@ -80,7 +85,6 @@
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
LocalStoreEnt
,
Staff
}
from
'@/Interface'
import
{
LocalStoreEnt
,
Staff
}
from
'@/Interface'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
axios
from
'axios'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
name
:
'AuthManagement'
,
name
:
'AuthManagement'
,
...
@@ -109,20 +113,8 @@ export default Vue.extend({
...
@@ -109,20 +113,8 @@ export default Vue.extend({
methods
:
{
methods
:
{
// 添加管理员
// 添加管理员
confirm
(
arr
:
string
[])
{
confirm
(
arr
:
string
[])
{
console
.
log
(
arr
,
'arr'
)
const
requests
=
[]
as
any
[]
if
(
arr
.
length
===
0
)
return
if
(
arr
.
length
===
0
)
return
arr
.
forEach
((
i
:
string
)
=>
{
this
.
changeRole
(
arr
[
0
],
1
)
requests
.
push
(
this
.
changeRole
(
i
,
1
))
})
this
.
loading
=
true
axios
.
all
(
requests
).
then
(
res
=>
{
this
.
loading
=
false
this
.
getSub
()
}).
catch
(
err
=>
{
this
.
loading
=
false
this
.
$toast
(
err
)
})
},
},
changeRole
(
id
:
string
,
role
:
number
)
{
changeRole
(
id
:
string
,
role
:
number
)
{
this
.
loading
=
true
this
.
loading
=
true
...
@@ -134,11 +126,13 @@ export default Vue.extend({
...
@@ -134,11 +126,13 @@ export default Vue.extend({
const
{
data
}
=
res
const
{
data
}
=
res
this
.
loading
=
false
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
return
data
.
data
this
.
$toast
(
'添加成功'
)
// this.getSub()
this
.
$router
.
push
(
'/team/team-management'
)
}
else
{
}
else
{
Promise
.
rejec
t
(
data
.
msg
)
this
.
$toas
t
(
data
.
msg
)
}
}
}).
catch
((
err
)
=>
Promise
.
reject
(
err
)
)
}).
catch
((
)
=>
this
.
loading
=
false
)
},
},
getSub
()
{
getSub
()
{
this
.
loading
=
true
this
.
loading
=
true
...
@@ -166,8 +160,10 @@ export default Vue.extend({
...
@@ -166,8 +160,10 @@ export default Vue.extend({
const
{
data
}
=
res
const
{
data
}
=
res
this
.
loading
=
false
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
// 转让成功
// 移除成功
this
.
$router
.
replace
(
'/team/team-frame'
)
this
.
$toast
(
'删除成功'
)
// this.getSub()
this
.
$router
.
push
(
'/team/team-management'
)
}
else
{
}
else
{
this
.
$toast
(
data
.
msg
)
this
.
$toast
(
data
.
msg
)
}
}
...
@@ -180,7 +176,7 @@ export default Vue.extend({
...
@@ -180,7 +176,7 @@ export default Vue.extend({
})
})
this
.
showMemberSelector
=
true
this
.
showMemberSelector
=
true
this
.
selectorTitle
=
'添加管理员'
this
.
selectorTitle
=
'添加管理员'
this
.
multiple
=
tru
e
this
.
multiple
=
fals
e
}
}
}
}
})
})
...
...
src/views/team/components/avator-editor.vue
View file @
7d26ad2e
<
template
>
<
template
>
<!-- 头像 -->
<!-- 头像 -->
<div
v-if=
"show"
class=
"
min-h-screen w-full border relative z-2001 bg-black px
-4"
>
<div
v-if=
"show"
class=
"
w-full h-screen overflow-y-scroll relative z-2001 bg-black pb
-4"
>
<van-action-sheet
<van-action-sheet
v-model=
"showActionSheet"
v-model=
"showActionSheet"
:actions=
"actions"
cancel-text=
"取消"
cancel-text=
"取消"
close-on-click-action
close-on-click-action
@
select=
"onSelect"
>
<div
class=
""
>
<!--
<div
class=
"px-4 py-3 text-center"
>
拍照
</div>
-->
<div
class=
"px-4 py-3 text-center"
@
click=
"uploadFile"
>
<div>
从手机相册中选择
</div>
<input
type=
"file"
id=
"uploadFile"
ref=
"uploadFile"
accept=
"image/*"
class=
"hidden"
@
input=
"fileHandler"
/>
/>
<div
class=
"header h-12 flex items-center justify-between"
>
</div>
</div>
</van-action-sheet>
<div
class=
"header w-full px-4 bg-black fixed top-0 left-0 z-2001 h-12 flex items-center justify-between"
>
<app-icon
<app-icon
class-name=
"w-6.5 h-6.5"
class-name=
"w-6.5 h-6.5"
icon-name=
"left-arrow-white"
icon-name=
"left-arrow-white"
...
@@ -21,17 +34,23 @@
...
@@ -21,17 +34,23 @@
@
click=
"showActionSheet=true"
@
click=
"showActionSheet=true"
/>
/>
</div>
</div>
<div
class=
"py-16 px-6"
>
<!-- 默认头像 -->
<!-- 默认头像 -->
<div
v-if=
"showDefault"
class=
"default-avator mt-4 rounde overflow-hidden mx-auto mt-4"
>
<div
v-if=
"showDefault"
class=
"mt-4"
>
<img
:src=
"defaultImg"
alt=
""
>
<div
class=
"default-avator flex items-center justify-center rounde overflow-hidden mx-auto"
>
<c-button
class=
"mt-4"
@
click=
"saveImage"
>
保存
</c-button>
<img
v-if=
"defaultImg"
:src=
"defaultImg"
alt=
""
>
<div
v-else
class=
"text-gray-200"
>
暂无头像
</div>
</div>
<c-button
v-if=
"defaultImg"
class=
"mt-4"
@
click=
"saveImage"
>
保存
</c-button>
</div>
</div>
<!-- 裁剪图片 -->
<!-- 裁剪图片 -->
<div
v-if=
"showCropper"
>
<div
class=
'cropper-wrapper'
v-if=
"showCropper"
>
<div
class=
"before"
></div>
<div
class=
"before"
></div>
<!--
<div
class=
"w-screnn h-screnn bg-center"
>
-->
<!--
<div
class=
"w-screnn h-screnn bg-center"
>
-->
<img
:src=
"img"
alt=
""
class=
""
ref=
"image"
>
<img
:src=
"img"
alt=
""
class=
""
ref=
"image"
>
<c-button
class=
"mt-4"
@
click=
"saveCropper"
>
保存
</c-button>
<div
class=
"fixed z-2001 bottom-0 left-0 w-full py-1.5 px-4"
>
<c-button
@
click=
"saveCropper"
>
保存
</c-button>
</div>
</div>
</div>
<!-- 拍照 -->
<!-- 拍照 -->
...
@@ -41,6 +60,7 @@
...
@@ -41,6 +60,7 @@
<c-button
class=
"mt-4"
@
click=
"saveImg"
>
拍照
</c-button>
<c-button
class=
"mt-4"
@
click=
"saveImg"
>
拍照
</c-button>
</div>
</div>
</div>
</div>
</div>
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
...
@@ -74,10 +94,10 @@ export default Vue.extend({
...
@@ -74,10 +94,10 @@ export default Vue.extend({
showDefault
:
true
,
showDefault
:
true
,
img
:
''
,
img
:
''
,
actions
:
[
actions
:
[
{
name
:
'拍照'
,
action
:
'photo'
},
//
{name: '拍照', action: 'photo'},
{
name
:
'从手机相册选择'
,
action
:
'file'
}
{
name
:
'从手机相册选择'
,
action
:
'file'
}
],
],
defaultImg
:
require
(
'@/assets/qrcode.png'
)
defaultImg
:
''
}
}
},
},
watch
:
{
watch
:
{
...
@@ -86,6 +106,28 @@ export default Vue.extend({
...
@@ -86,6 +106,28 @@ export default Vue.extend({
}
}
},
},
methods
:
{
methods
:
{
fileHandler
(
e
:
InputEvent
)
{
const
target
=
e
.
target
as
HTMLInputElement
if
(
target
.
files
&&
target
.
files
?.
length
!==
0
)
{
console
.
log
(
target
.
files
)
const
file
=
target
.
files
[
0
]
const
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onloadend
=
()
=>
{
this
.
img
=
reader
.
result
as
string
this
.
showCropper
=
true
this
.
showDefault
=
false
this
.
$nextTick
(()
=>
{
this
.
initCropper
()
})
}
}
},
uploadFile
()
{
const
fileInput
=
this
.
$refs
.
uploadFile
as
HTMLInputElement
fileInput
.
click
()
this
.
showActionSheet
=
false
},
goBack
()
{
goBack
()
{
this
.
$emit
(
'update:show'
,
false
)
this
.
$emit
(
'update:show'
,
false
)
},
},
...
@@ -101,7 +143,7 @@ export default Vue.extend({
...
@@ -101,7 +143,7 @@ export default Vue.extend({
},
},
// 保存头像
// 保存头像
saveImage
()
{
saveImage
()
{
// this.showAvato
r = false
this
.
showCroppe
r
=
false
this
.
$emit
(
'update:img-src'
,
this
.
defaultImg
)
this
.
$emit
(
'update:img-src'
,
this
.
defaultImg
)
this
.
$emit
(
'update:show'
,
false
)
this
.
$emit
(
'update:show'
,
false
)
},
},
...
@@ -129,12 +171,13 @@ export default Vue.extend({
...
@@ -129,12 +171,13 @@ export default Vue.extend({
}
}
},
},
initCropper
()
{
initCropper
()
{
this
.
myCropper
.
destroy
&&
this
.
myCropper
.
destroy
()
this
.
myCropper
=
new
Cropper
(
this
.
$refs
.
image
as
HTMLImageElement
,
{
this
.
myCropper
=
new
Cropper
(
this
.
$refs
.
image
as
HTMLImageElement
,
{
viewMode
:
1
,
viewMode
:
1
,
dragMode
:
'none'
,
dragMode
:
'none'
,
initialAspectRatio
:
1
,
initialAspectRatio
:
1
,
aspectRatio
:
1
,
aspectRatio
:
1
,
preview
:
'.before'
,
//
preview: '.before',
background
:
false
,
background
:
false
,
autoCropArea
:
0.6
,
autoCropArea
:
0.6
,
zoomOnWheel
:
false
,
zoomOnWheel
:
false
,
...
@@ -195,7 +238,9 @@ export default Vue.extend({
...
@@ -195,7 +238,9 @@ export default Vue.extend({
this
.
defaultImg
=
imgData
this
.
defaultImg
=
imgData
this
.
showDefault
=
true
this
.
showDefault
=
true
this
.
showCropper
=
false
this
.
showCropper
=
false
this
.
myCropper
.
destroy
()
},
},
// 摄像头读取头像
saveImg
()
{
saveImg
()
{
this
.
readImg
()
this
.
readImg
()
this
.
stream
.
getTracks
().
forEach
(
function
(
track
:
any
){
this
.
stream
.
getTracks
().
forEach
(
function
(
track
:
any
){
...
@@ -238,11 +283,14 @@ export default Vue.extend({
...
@@ -238,11 +283,14 @@ export default Vue.extend({
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
/deep/ .cropper-container {
/deep/ .cropper-container {
width: 100% !important
// width: 100% !important;
}
}
.default-avator {
.default-avator {
min-width: 60vw;
min-width: 60vw;
min-height: 60vw;
min-height: 60vw;
// border: 1px solid red;
// border: 1px solid red;
}
}
.cropper-wrapper {
height: calc(100vh - 140px)
}
</
style
>
</
style
>
src/views/team/components/contact-member.vue
View file @
7d26ad2e
...
@@ -19,6 +19,9 @@
...
@@ -19,6 +19,9 @@
>
>
主管
主管
</div>
</div>
<div
v-if=
"!member.isActivated"
class=
"tag ml-1.5 text-xs text-text-secondary px-1 py-0.5 bg-mygray rounded"
>
未激活
</div>
</div>
</div>
</
template
>
</
template
>
...
...
src/views/team/components/member-selector.vue
View file @
7d26ad2e
...
@@ -121,7 +121,7 @@ export default Vue.extend({
...
@@ -121,7 +121,7 @@ export default Vue.extend({
}
}
},
},
mounted
()
{
mounted
()
{
this
.
entId
=
JSON
.
parse
(
localStorage
.
getItem
(
'
ENT_INFO'
)
||
'{}'
).
i
d
this
.
entId
=
JSON
.
parse
(
localStorage
.
getItem
(
'
USR_INFO'
)
||
'{}'
).
entI
d
this
.
getEntInfo
()
this
.
getEntInfo
()
},
},
computed
:
{
computed
:
{
...
...
src/views/team/join-team/confirm-join.vue
View file @
7d26ad2e
...
@@ -7,12 +7,13 @@
...
@@ -7,12 +7,13 @@
:loading=
"loading"
:loading=
"loading"
>
>
<!-- 顶部左侧插槽 -->
<!-- 顶部左侧插槽 -->
<!--
<div
v-if=
"!fromPc"
slot=
"left"
>
<app-icon
<app-icon
slot=
"left"
class-name=
"w-6.5 w-6.5"
class-name=
"w-6.5 w-6.5"
icon-name=
"left-arrow-white"
icon-name=
"left-arrow-white"
@
click=
"appNavBack()"
@
click=
"appNavBack()"
/>
/>
</div>
-->
<div
class=
"relative w-full h-40 bg-color-primary"
>
<div
class=
"relative w-full h-40 bg-color-primary"
>
<!-- 背景图 -->
<!-- 背景图 -->
<!--
<img
class=
"w-82 absolute top-0 right-0"
src=
"@/assets/images/header-bg.png"
alt=
""
>
-->
<!--
<img
class=
"w-82 absolute top-0 right-0"
src=
"@/assets/images/header-bg.png"
alt=
""
>
-->
...
@@ -23,14 +24,15 @@
...
@@ -23,14 +24,15 @@
<div
class=
"top-28 px-4 w-full absolute top-10"
>
<div
class=
"top-28 px-4 w-full absolute top-10"
>
<div
class=
"bg-white w-full rounded pt-8 pb-4 flex flex-col items-center shadow-bg"
>
<div
class=
"bg-white w-full rounded pt-8 pb-4 flex flex-col items-center shadow-bg"
>
<div
class=
"font-medium"
>
{{
entName
}}
</div>
<div
class=
"font-medium"
>
{{
entName
}}
</div>
<!--
<div
class=
"font-medium text-sm text-text-secondary mt-0.5"
>
团队号 HZFZM0001
</div>
-->
<div
class=
"font-medium text-sm text-text-secondary mt-0.5"
>
服务器
{{
info
.
oaServer
}}
</div>
<div
class=
"font-medium text-sm text-text-secondary mt-0.5"
>
团队号
{{
info
.
entId
}}
</div>
<!--
<div
class=
"h-20 overflow-auto text-xs text-text-secondary px-4 mt-3.5"
>
<!--
<div
class=
"h-20 overflow-auto text-xs text-text-secondary px-4 mt-3.5"
>
公司成立于2008年,2013 年启动区块链、智能合约的研发与创新,2014年申请区块链发明专利:钱包找回功能。已申请区块链相关专利500余项,其中已获得授权超80项,2019年据德温特专利家族统计,复杂美区块链发明专利排名位于全球第三,仅次于阿里巴巴和IBM。 公司总部位于杭州,并在南京、广州、海南设有分部。目前,公司员工100余人,其中80%左右为技术人员,吸引了一批甲骨文、阿里、华为程序员。公司与多家世界500强开展区块链项目合作,在票据、供应链金融、积分、仓单有区块链应用落地。 2018年11月,复杂美区块链Chain33在Github上开源,是较早落地运行的平行链架构系统,并基于模块设计可协作开发,大幅降低区块链的开发维护成本,实现快捷易用的跨链交易,有近100个平行链项目落地,去中心化交易、去中心化社交、去中心化电商、去中心化溯源存证、去中心化借贷等一系列应用。
公司成立于2008年,2013 年启动区块链、智能合约的研发与创新,2014年申请区块链发明专利:钱包找回功能。已申请区块链相关专利500余项,其中已获得授权超80项,2019年据德温特专利家族统计,复杂美区块链发明专利排名位于全球第三,仅次于阿里巴巴和IBM。 公司总部位于杭州,并在南京、广州、海南设有分部。目前,公司员工100余人,其中80%左右为技术人员,吸引了一批甲骨文、阿里、华为程序员。公司与多家世界500强开展区块链项目合作,在票据、供应链金融、积分、仓单有区块链应用落地。 2018年11月,复杂美区块链Chain33在Github上开源,是较早落地运行的平行链架构系统,并基于模块设计可协作开发,大幅降低区块链的开发维护成本,实现快捷易用的跨链交易,有近100个平行链项目落地,去中心化交易、去中心化社交、去中心化电商、去中心化溯源存证、去中心化借贷等一系列应用。
</div>
-->
</div>
-->
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"px-4 pt-
16
pb-28"
>
<div
class=
"px-4 pt-
24
pb-28"
>
<group-cell
title=
"个人信息"
>
<group-cell
title=
"个人信息"
>
<c-cell
<c-cell
title=
"真实姓名"
title=
"真实姓名"
...
@@ -62,6 +64,12 @@
...
@@ -62,6 +64,12 @@
>
>
<div
slot=
"content"
class=
"text-text-primary"
>
{{
info
.
phone
}}
</div>
<div
slot=
"content"
class=
"text-text-primary"
>
{{
info
.
phone
}}
</div>
</c-cell>
</c-cell>
<c-cell
title=
"短号"
title-class=
"text-sm text-text-secondary"
>
<div
slot=
"content"
class=
"text-text-primary"
>
{{
info
.
shortPhone
}}
</div>
</c-cell>
</group-cell>
</group-cell>
<!-- 底部操作 -->
<!-- 底部操作 -->
<div
class=
"pt-1 pb-3 px-4 bg-common-bg w-screen fixed bottom-0 left-0 z-30"
>
<div
class=
"pt-1 pb-3 px-4 bg-common-bg w-screen fixed bottom-0 left-0 z-30"
>
...
@@ -77,7 +85,11 @@
...
@@ -77,7 +85,11 @@
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
formatDate
}
from
'@/util/FormatDate'
import
{
formatDate
}
from
'@/util/FormatDate'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
{
AcceptJoinDTO
}
from
'@/service/moudles/service.dto'
import
{
appNavBack
,
getSign
,
goBack
,
refreshCompanyState
}
from
'@/util/Bridge'
import
{
appNavBack
,
getSign
,
close
,
refreshCompanyState
}
from
'@/util/Bridge'
interface
QueryInfo
extends
AcceptJoinDTO
{
sig
?:
string
}
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
name
:
'JoinTeam'
,
name
:
'JoinTeam'
,
...
@@ -90,7 +102,7 @@ export default Vue.extend({
...
@@ -90,7 +102,7 @@ export default Vue.extend({
'c-cell'
:
()
=>
import
(
'@/components/common/c-cell.vue'
)
'c-cell'
:
()
=>
import
(
'@/components/common/c-cell.vue'
)
},
},
data
()
{
data
()
{
const
info
:
AcceptJoinDTO
=
{
const
info
:
QueryInfo
=
{
expiration
:
0
,
expiration
:
0
,
inviterId
:
''
,
inviterId
:
''
,
name
:
''
,
name
:
''
,
...
@@ -107,12 +119,19 @@ export default Vue.extend({
...
@@ -107,12 +119,19 @@ export default Vue.extend({
info
,
info
,
departName
:
''
,
departName
:
''
,
entName
:
''
,
entName
:
''
,
loading
:
false
loading
:
false
,
fromPc
:
false
}
}
},
},
created
()
{
created
()
{
this
.
info
=
this
.
$route
.
query
as
unknown
as
AcceptJoinDTO
this
.
info
=
this
.
$route
.
query
as
unknown
as
QueryInfo
// this.entName = JSON.parse(localStorage.getItem('ENT_INFO') as string).name
// this.entName = JSON.parse(localStorage.getItem('ENT_INFO') as string).name
const
sig
=
this
.
info
.
sig
if
(
typeof
this
.
info
.
sig
!==
'undefined'
&&
this
.
info
.
sig
!==
''
)
{
// 聊天pc进入
this
.
$global
.
sig
=
decodeURIComponent
(
sig
as
string
)
this
.
fromPc
=
true
}
this
.
getDepInfo
(
this
.
info
)
this
.
getDepInfo
(
this
.
info
)
this
.
getEntInfo
(
this
.
info
)
this
.
getEntInfo
(
this
.
info
)
},
},
...
@@ -120,9 +139,9 @@ export default Vue.extend({
...
@@ -120,9 +139,9 @@ export default Vue.extend({
appNavBack
,
appNavBack
,
async
submit
()
{
async
submit
()
{
this
.
loading
=
true
this
.
loading
=
true
const
{
depId
,
entId
,
expiration
,
hash
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
}
=
this
.
info
as
AcceptJoinDTO
const
{
depId
,
entId
,
expiration
,
hash
,
inviterId
,
joinTime
,
name
,
oaServer
,
phone
,
position
,
shortPhone
}
=
this
.
info
as
AcceptJoinDTO
let
req
=
{
let
req
=
{
depId
,
entId
,
expiration
:
Number
(
expiration
)
,
hash
,
inviterId
,
joinTime
:
Number
(
joinTime
),
name
,
oaServer
,
phone
,
position
depId
,
entId
,
expiration
:
Number
(
expiration
)
,
hash
,
inviterId
,
joinTime
:
Number
(
joinTime
),
name
,
oaServer
,
phone
,
position
,
shortPhone
}
}
console
.
log
(
this
.
info
);
console
.
log
(
this
.
info
);
this
.
$service
.
enterprise
.
acceptJoin
(
req
)
this
.
$service
.
enterprise
.
acceptJoin
(
req
)
...
@@ -130,11 +149,15 @@ export default Vue.extend({
...
@@ -130,11 +149,15 @@ export default Vue.extend({
const
{
data
}
=
res
const
{
data
}
=
res
this
.
loading
=
false
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
this
.
fromPc
)
{
parent
.
location
.
reload
()
return
}
this
.
$toast
(
'加入成功'
)
this
.
$toast
(
'加入成功'
)
this
.
$store
.
commit
(
'acceptJoin'
,
{})
this
.
$store
.
commit
(
'acceptJoin'
,
{})
// this.$router.replace('/team/team-frame')
// this.$router.replace('/team/team-frame')
await
refreshCompanyState
()
await
refreshCompanyState
()
goBack
()
close
()
}
else
{
}
else
{
this
.
$toast
(
data
.
msg
)
this
.
$toast
(
data
.
msg
)
}
}
...
@@ -151,7 +174,7 @@ export default Vue.extend({
...
@@ -151,7 +174,7 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
departName
=
data
.
data
.
name
this
.
departName
=
data
.
data
.
name
}
}
})
})
.
catch
(()
=>
this
.
loading
=
false
)
},
},
getEntInfo
(
item
:
AcceptJoinDTO
)
{
getEntInfo
(
item
:
AcceptJoinDTO
)
{
this
.
loading
=
true
this
.
loading
=
true
...
@@ -163,7 +186,7 @@ export default Vue.extend({
...
@@ -163,7 +186,7 @@ export default Vue.extend({
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
entName
=
data
.
data
.
name
this
.
entName
=
data
.
data
.
name
}
}
})
})
.
catch
(()
=>
this
.
loading
=
false
)
}
}
}
}
})
})
...
...
src/views/team/team-frame.vue
View file @
7d26ad2e
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
<app-icon
<app-icon
class-name=
"w-6.5 h-6.5"
class-name=
"w-6.5 h-6.5"
icon-name=
"home"
icon-name=
"home"
@
click=
"
close
"
@
click=
"
handleBack
"
/>
/>
</div>
</div>
<template
slot=
"right"
>
<template
slot=
"right"
>
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
getUserInfo
,
close
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
getUserInfo
,
close
,
goBack
,
openCompanyUserInfo
}
from
'@/util/Bridge'
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
Department
,
Staff
}
from
'@/Interface'
import
{
ActionSheet
}
from
'vant'
import
{
ActionSheet
}
from
'vant'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
Role
}
from
'@/service/moudles/service.dto'
...
@@ -113,7 +113,6 @@ export default Vue.extend({
...
@@ -113,7 +113,6 @@ export default Vue.extend({
parentId
:
''
,
parentId
:
''
,
entId
:
''
,
entId
:
''
,
ifContainChildDep
:
true
,
ifContainChildDep
:
true
,
enterpriseInfo
:
{},
currentDep
,
currentDep
,
// 是否显示check
// 是否显示check
checkedMemberId
:
[],
checkedMemberId
:
[],
...
@@ -127,18 +126,22 @@ export default Vue.extend({
...
@@ -127,18 +126,22 @@ export default Vue.extend({
}
}
},
},
async
mounted
()
{
async
mounted
()
{
// const userInfoDev = {
const
userInfoDev
=
{
// depId: '168398222891421697',
depId
:
'168398222891421697'
,
// entId: '168398222891421696',
entId
:
'168398222891421696'
,
// id: '1K7cApKbEU9h5WySPVLNgdSd67i2XkSuoS',
id
:
'1K7cApKbEU9h5WySPVLNgdSd67i2XkSuoS'
,
// joinTime: 1631090065,
joinTime
:
1631090065
,
// name: '徐丹',
name
:
'徐丹'
,
// role: 0
role
:
0
// }
}
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
localStorage
.
setItem
(
'USR_INFO'
,
getUserInfo
())
localStorage
.
setItem
(
'USR_INFO'
,
getUserInfo
())
const
usrInfo
=
process
.
env
.
NODE_ENV
===
'production'
?
JSON
.
parse
(
getUserInfo
()
||
"{}"
)
:
{}
}
else
{
localStorage
.
setItem
(
'USR_INFO'
,
JSON
.
stringify
(
userInfoDev
))
}
const
usrInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'USR_INFO'
)
as
string
)
this
.
role
=
usrInfo
.
role
this
.
role
=
usrInfo
.
role
this
.
entId
=
process
.
env
.
NODE_ENV
===
'production'
?
usrInfo
.
entId
:
'168398222891421696'
this
.
entId
=
usrInfo
.
entId
this
.
getEntInfo
()
this
.
getEntInfo
()
},
},
computed
:
{
computed
:
{
...
@@ -160,6 +163,9 @@ export default Vue.extend({
...
@@ -160,6 +163,9 @@ export default Vue.extend({
}
}
},
},
methods
:
{
methods
:
{
handleBack
()
{
this
.
close
()
},
handleAction
(
item
:
{
name
:
string
,
action
:
string
})
{
handleAction
(
item
:
{
name
:
string
,
action
:
string
})
{
if
(
item
.
action
===
'manage'
)
{
if
(
item
.
action
===
'manage'
)
{
this
.
$router
.
push
(
'/team/team-management'
)
this
.
$router
.
push
(
'/team/team-management'
)
...
@@ -167,6 +173,32 @@ export default Vue.extend({
...
@@ -167,6 +173,32 @@ export default Vue.extend({
}
}
if
(
item
.
action
===
'edit'
)
{
if
(
item
.
action
===
'edit'
)
{
this
.
isEdit
=
true
this
.
isEdit
=
true
return
}
if
(
item
.
action
===
'quit'
)
{
this
.
$dialog
.
confirm
({
title
:
'提示'
,
message
:
'确定要退出当前团队吗?'
// confirmButtonText: '解散'
}).
then
(()
=>
{
const
entId
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
as
string
).
id
const
id
=
JSON
.
parse
(
localStorage
.
getItem
(
'USR_INFO'
)
as
string
).
id
this
.
loading
=
true
this
.
$service
.
staff
.
resign
({
entId
,
id
}).
then
((
res
:
any
)
=>
{
this
.
loading
=
false
const
{
data
}
=
res
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
close
()
}
else
{
this
.
$toast
(
data
.
msg
)
}
})
}).
catch
(()
=>
{
console
.
log
(
'取消解散'
)
})
}
}
},
},
confirmEdit
()
{
confirmEdit
()
{
...
@@ -187,6 +219,7 @@ export default Vue.extend({
...
@@ -187,6 +219,7 @@ export default Vue.extend({
},
},
// 返回原生页面
// 返回原生页面
close
,
close
,
goBack
,
// 获取企业信息
// 获取企业信息
getEntInfo
()
{
getEntInfo
()
{
this
.
loading
=
true
this
.
loading
=
true
...
...
src/views/team/team-info/team-info.vue
View file @
7d26ad2e
<
template
>
<
template
>
<!-- 完善团队信息 -->
<!-- 完善团队信息 -->
<main-page
<main-page
:loading=
"loading"
left-arrow
left-arrow
@
click-left=
"$router.
go(-1
)"
@
click-left=
"$router.
push('/team/team-management'
)"
>
>
<avator-editor
<avator-editor
:show
.
sync=
"showEditor"
:show
.
sync=
"showEditor"
:img-src
.
sync=
"defaultImg"
:img-src
.
sync=
"defaultImg"
/>
/>
<div
class=
"px-4 pt-14"
>
<div
v-if=
"!showEditor"
class=
"px-4 pt-14"
>
<c-cell
<c-cell
dot
dot
title=
"团队头像"
title=
"团队头像"
...
@@ -16,7 +17,7 @@
...
@@ -16,7 +17,7 @@
>
>
<template
slot=
"right"
>
<template
slot=
"right"
>
<div
class=
"w-7 h-7 rounded overflow-hidden flex items-center justify-center"
>
<div
class=
"w-7 h-7 rounded overflow-hidden flex items-center justify-center"
>
<img
class=
"max-w-full"
:src=
"defaultImg"
alt=
""
>
<img
v-if=
"defaultImg"
class=
"max-w-full"
:src=
"defaultImg"
alt=
""
>
</div>
</div>
</
template
>
</
template
>
</c-cell>
</c-cell>
...
@@ -38,7 +39,7 @@
...
@@ -38,7 +39,7 @@
label=
"团队描述"
label=
"团队描述"
placeholder=
"请输入团队描述"
placeholder=
"请输入团队描述"
/>
/>
<c-button
class=
"mt-4"
>
保存
</c-button>
<c-button
class=
"mt-4"
@
click=
"save"
>
保存
</c-button>
</div>
</div>
</main-page>
</main-page>
</template>
</template>
...
@@ -46,9 +47,10 @@
...
@@ -46,9 +47,10 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
Vue
from
'vue'
import
Vue
from
'vue'
import
{
updateEnterpriseDTO
}
from
'@/service/moudles/service.dto'
import
{
updateEnterpriseDTO
}
from
'@/service/moudles/service.dto'
// import Cropper from "cropperjs"
// import "cropperjs/dist/cropper.css"
import
{
ActionSheet
}
from
'vant'
import
{
ActionSheet
}
from
'vant'
import
axios
from
'axios'
import
{
signAuth
}
from
'@/util/Bridge'
import
{
EnterpriseInfo
}
from
'@/store/store.dto'
Vue
.
use
(
ActionSheet
)
Vue
.
use
(
ActionSheet
)
...
@@ -67,23 +69,99 @@ export default Vue.extend({
...
@@ -67,23 +69,99 @@ export default Vue.extend({
updateInfo
:
{}
as
updateEnterpriseDTO
,
updateInfo
:
{}
as
updateEnterpriseDTO
,
showActionSheet
:
false
,
showActionSheet
:
false
,
defaultImg
:
require
(
'@/assets/qrcode.png'
),
defaultImg
:
require
(
'@/assets/qrcode.png'
),
showEditor
:
false
showEditor
:
false
,
loading
:
false
,
entInfo
:
{}
as
EnterpriseInfo
}
}
},
},
mounted
()
{
mounted
()
{
// const service = new BaseService()
// service.useService
this
.
entInfo
=
{...
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
as
string
)}
const
{
id
,
avatar
,
description
,
name
}
=
this
.
entInfo
this
.
updateInfo
=
{
id
,
avatar
,
description
,
name
}
this
.
defaultImg
=
avatar
},
},
methods
:
{
methods
:
{
// onSelect(item: {name: string, action: string}) {
// base64 转 file
// if (item.action === 'photo') {
transferFile
(
base64Str
:
string
,
fileName
:
string
)
{
// this.showCamera = true
let
arr
=
base64Str
.
split
(
','
),
// this.showDefault = false
mime
=
(
arr
[
0
].
match
(
/:
(
.*
?)
;/
)
as
any
)[
1
],
//base64解析出来的图片类型
// // this.showVideo=true
bstr
=
atob
(
arr
[
1
])
,
//对base64串进行操作,去掉url头,并转换为byte atob为window内置方法
// this.$nextTick(() => {
len
=
bstr
.
length
,
// this.openCamera()
ab
=
new
ArrayBuffer
(
len
),
//将ASCII码小于0的转换为大于0
// })
u8arr
=
new
Uint8Array
(
ab
)
//
// }
while
(
len
--
)
{
// }
u8arr
[
len
]
=
bstr
.
charCodeAt
(
len
)
}
// 创建新的 File 对象实例[utf-8内容,文件名称或者路径,[可选参数,type:文件中的内容mime类型]]
return
new
File
([
u8arr
],
fileName
,
{
type
:
mime
})
},
async
getImgUrl
()
{
const
imServer
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
as
string
).
imServer
const
token
=
process
.
env
.
NODE_ENV
===
'production'
?
signAuth
()
:
"MOCK"
const
file
=
this
.
transferFile
(
this
.
defaultImg
,
'text'
)
const
formData
=
new
FormData
()
formData
.
append
(
'appId'
,
'dtalk'
)
formData
.
append
(
'key'
,
`oa/
${
this
.
entInfo
.
id
}
`
)
formData
.
append
(
'file'
,
file
)
return
axios
({
method
:
'post'
,
url
:
`
${
imServer
}
/oss/upload`
,
data
:
formData
,
headers
:
{
'content-type'
:
'multipart/form-data'
,
'FZM-SIGNATURE'
:
token
}
}).
then
((
res
:
any
)
=>
{
return
res
.
data
.
data
})
},
async
save
()
{
const
{
description
,
name
}
=
this
.
updateInfo
if
(
!
description
||
!
name
||
!
this
.
defaultImg
)
{
this
.
$toast
(
'请检查填写信息'
)
return
}
if
(
this
.
defaultImg
.
indexOf
(
';base64'
)
>
-
1
)
{
const
imgUrlObj
=
await
this
.
getImgUrl
()
this
.
updateInfo
.
avatar
=
imgUrlObj
.
url
}
else
{
this
.
updateInfo
.
avatar
=
this
.
defaultImg
}
this
.
loading
=
true
this
.
$service
.
enterprise
.
updateEnterprise
(
this
.
updateInfo
)
.
then
((
res
:
any
)
=>
{
this
.
loading
=
false
const
{
data
}
=
res
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
$toast
(
'修改成功'
)
this
.
getEntInfo
(
this
.
updateInfo
.
id
)
}
else
{
this
.
$toast
(
data
.
msg
)
}
}).
catch
(()
=>
this
.
loading
=
false
)
},
getEntInfo
(
id
:
string
)
{
this
.
loading
=
true
this
.
$service
.
enterprise
.
getEnterpriseInfo
({
id
})
.
then
((
res
:
any
)
=>
{
const
{
data
}
=
res
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
localStorage
.
setItem
(
'ENT_INFO'
,
JSON
.
stringify
(
data
.
data
))
this
.
entInfo
=
data
.
data
this
.
defaultImg
=
data
.
data
.
avatar
}
})
}
}
}
})
})
</
script
>
</
script
>
...
...
src/views/team/team-management.vue
View file @
7d26ad2e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<main-page
<main-page
left-arrow
left-arrow
:loading=
"loading"
:loading=
"loading"
@
click-left=
"
$router.replace('/team/team-frame')
"
@
click-left=
"
goBack
"
>
>
<!-- 右侧二维码图标 -->
<!-- 右侧二维码图标 -->
<template
slot=
"right"
>
<template
slot=
"right"
>
...
@@ -33,24 +33,35 @@
...
@@ -33,24 +33,35 @@
/>
/>
<div
class=
"px-4 pt-14"
>
<div
class=
"px-4 pt-14"
>
<!-- 头部 -->
<!-- 头部 -->
<div
class=
"flex items-center pt-1 pb-5"
>
<div
class=
"flex items-start pt-1 pb-5"
>
<div
class=
"h-13 w-13 rounded overflow-hidden flex-shrink-0"
>
<div
v-if=
"enterpriseInfo.avatar"
>
<img
:src=
"enterpriseInfo.avatar"
alt=
""
>
</div>
<div
v-else
class=
""
>
<app-icon
<app-icon
type=
"png"
type=
"png"
:path=
"require('@/assets/icons/team-icon.png')"
:path=
"require('@/assets/icons/team-icon.png')"
class-name=
"h-13 w-13"
class-name=
"h-13 w-13"
/>
/>
</div>
</div>
<!-- 名称 -->
<!-- 名称 -->
<div
class=
"ml-4 flex-1 text-text-primary"
>
<div
class=
"ml-4 flex-1 text-text-primary
overflow-hidden
"
>
<span
class=
"break-all"
>
<span
class=
"break-all"
>
{{ enterpriseInfo.name }}
{{ enterpriseInfo.name }}
</span>
</span>
<!-- 团队号 -->
<!-- 团队号 -->
<!-- <div class="text-text-secondary text-sm font-medium mt-1.5">
<div
class=
"text-text-secondary text-sm"
>
团队号 ABCDE1234
<div
class=
"mt-1 truncate"
>
团队号 {{enterpriseInfo.id}}
</div>
</div> -->
<div
class=
""
></div>
<div
class=
"truncate"
>
服务器 {{enterpriseInfo.oaServer}}
</div>
<div
class=
""
></div>
</div>
</div>
</div>
</div>
</div>
<c-cell
dot
title=
"
团队
架构"
@
click=
"$router.push('/team/team-frame')"
/>
<c-cell
dot
title=
"
组织
架构"
@
click=
"$router.push('/team/team-frame')"
/>
<c-cell
dot
title=
"添加成员"
@
click=
"$router.push('/team/add-member')"
/>
<c-cell
dot
title=
"添加成员"
@
click=
"$router.push('/team/add-member')"
/>
<c-cell
dot
title=
"添加部门"
@
click=
"$router.push('/team/add-department')"
/>
<c-cell
dot
title=
"添加部门"
@
click=
"$router.push('/team/add-department')"
/>
<div
class=
"mt-4"
>
<div
class=
"mt-4"
>
...
@@ -70,6 +81,7 @@
...
@@ -70,6 +81,7 @@
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
Role
}
from
'@/service/moudles/service.dto'
import
{
LocalStoreEnt
,
Staff
}
from
'@/Interface'
import
{
LocalStoreEnt
,
Staff
}
from
'@/Interface'
import
{
close
,
getUserInfo
}
from
'@/util/Bridge'
import
Vue
from
'vue'
import
Vue
from
'vue'
export
default
Vue
.
extend
({
export
default
Vue
.
extend
({
...
@@ -81,6 +93,12 @@ export default Vue.extend({
...
@@ -81,6 +93,12 @@ export default Vue.extend({
'c-button'
:
()
=>
import
(
'@/components/common/c-button.vue'
),
'c-button'
:
()
=>
import
(
'@/components/common/c-button.vue'
),
'member-selector'
:
()
=>
import
(
'@/views/team/components/member-selector.vue'
)
'member-selector'
:
()
=>
import
(
'@/views/team/components/member-selector.vue'
)
},
},
beforeRouteEnter
(
to
,
from
,
next
)
{
const
path
=
from
.
path
next
((
vm
:
any
)
=>
{
vm
.
fromFrame
=
path
===
'/team/team-frame'
})
},
data
()
{
data
()
{
return
{
return
{
enterpriseInfo
:
{}
as
LocalStoreEnt
,
enterpriseInfo
:
{}
as
LocalStoreEnt
,
...
@@ -89,20 +107,46 @@ export default Vue.extend({
...
@@ -89,20 +107,46 @@ export default Vue.extend({
showMemberSelector
:
false
,
showMemberSelector
:
false
,
selectorTitle
:
''
,
selectorTitle
:
''
,
multiple
:
false
,
multiple
:
false
,
selectedLeaderId
:
[]
as
string
[]
selectedLeaderId
:
[]
as
string
[],
fromFrame
:
true
,
// 企业id,跟部门id
entId
:
''
}
}
},
},
mounted
()
{
created
()
{
this
.
enterpriseInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'ENT_INFO'
)
as
string
)
const
userInfoDev
=
{
this
.
getSub
()
depId
:
'168398222891421697'
,
entId
:
'168398222891421696'
,
id
:
'1K7cApKbEU9h5WySPVLNgdSd67i2XkSuoS'
,
joinTime
:
1631090065
,
name
:
'徐丹'
,
role
:
0
}
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
localStorage
.
setItem
(
'USR_INFO'
,
getUserInfo
())
}
else
{
localStorage
.
setItem
(
'USR_INFO'
,
JSON
.
stringify
(
userInfoDev
))
}
const
usrInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
'USR_INFO'
)
as
string
)
this
.
entId
=
usrInfo
.
entId
this
.
getEntInfo
()
// this.enterpriseInfo = JSON.parse(localStorage.getItem('ENT_INFO') as string)
// this.getSub()
},
},
computed
:
{
computed
:
{
isLeader
()
{
isLeader
()
{
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
"USR_INFO"
)
as
string
)
const
userInfo
=
JSON
.
parse
(
localStorage
.
getItem
(
"USR_INFO"
)
as
string
)
return
userInfo
.
role
===
Role
.
LEADER
return
userInfo
?
.
role
===
Role
.
LEADER
}
}
},
},
methods
:
{
methods
:
{
goBack
()
{
if
(
this
.
fromFrame
)
{
this
.
$router
.
push
(
'/team/team-frame'
)
}
else
{
close
()
}
},
getSub
()
{
getSub
()
{
const
{
id
,
rootDepId
}
=
this
.
enterpriseInfo
const
{
id
,
rootDepId
}
=
this
.
enterpriseInfo
this
.
loading
=
true
this
.
loading
=
true
...
@@ -122,6 +166,22 @@ export default Vue.extend({
...
@@ -122,6 +166,22 @@ export default Vue.extend({
}
}
}).
catch
(()
=>
this
.
loading
=
false
)
}).
catch
(()
=>
this
.
loading
=
false
)
},
},
getEntInfo
()
{
this
.
loading
=
true
this
.
$service
.
enterprise
.
getEnterpriseInfo
({
id
:
this
.
entId
}).
then
((
res
:
any
)
=>
{
const
{
data
}
=
res
this
.
loading
=
false
if
(
data
.
code
===
this
.
$global
.
success
)
{
localStorage
.
setItem
(
'ENT_INFO'
,
JSON
.
stringify
(
data
.
data
))
this
.
enterpriseInfo
=
data
.
data
this
.
getSub
()
}
else
{
this
.
$toast
(
data
.
msg
)
}
})
},
editTeamName
()
{
editTeamName
()
{
console
.
log
(
'edit'
)
console
.
log
(
'edit'
)
this
.
$router
.
push
(
'/team/team-info'
)
this
.
$router
.
push
(
'/team/team-info'
)
...
@@ -163,6 +223,8 @@ export default Vue.extend({
...
@@ -163,6 +223,8 @@ export default Vue.extend({
const
{
data
}
=
res
const
{
data
}
=
res
if
(
data
.
code
===
this
.
$global
.
success
)
{
if
(
data
.
code
===
this
.
$global
.
success
)
{
this
.
$toast
(
'解散成功'
)
this
.
$toast
(
'解散成功'
)
localStorage
.
removeItem
(
'ENT_INFO'
)
close
()
}
else
{
}
else
{
this
.
$toast
(
data
.
msg
)
this
.
$toast
(
data
.
msg
)
}
}
...
...
src/views/team/two-code.vue
View file @
7d26ad2e
...
@@ -41,19 +41,22 @@
...
@@ -41,19 +41,22 @@
<div
class=
" text-center text-gray-400 pb-8 pt-4"
>
扫描二维码加入
{{
entName
}}
</div>
<div
class=
" text-center text-gray-400 pb-8 pt-4"
>
扫描二维码加入
{{
entName
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
"w-24 m
l-auto mt-4
"
>
<div
class=
"w-24 m
t-4 ml-auto
"
>
<c-button
@
click=
"saveQrcode"
>
保存
</c-button>
<c-button
@
click=
"saveQrcode"
>
保存
</c-button>
</div>
</div>
<div
class=
"mt-4 border text-sm text-text-secondary border border-border rounded break-all p-2"
>
<div
class=
"mt-4 border text-sm text-text-secondary border border-border rounded break-all p-2"
>
{{
copyText
}}
{{
copyText
}}
</div>
</div>
<div
class=
"w-24 ml-auto mt-4"
>
<div
class=
"flex mt-4 items-center justify-between"
>
<div
class=
"text-sm text-color-primary bg-color-primary-light px-6 py-2.5 rounded flex-shrink-0"
>
仅适用于网页版打开
</div>
<div
class=
"w-24"
>
<c-button
<c-button
id=
"copyBtn"
id=
"copyBtn"
:data-clipboard-text=
"qrCode
Text"
:data-clipboard-text=
"copy
Text"
data-clipboard-action=
"copy"
data-clipboard-action=
"copy"
@
click=
"copy"
>
复制
</c-button>
@
click=
"copy"
>
复制
</c-button>
</div>
</div>
</div>
<c-button
type=
"secondary"
class=
"mt-4"
@
click=
"handleClickLeft"
>
进入团队工作台
</c-button>
<c-button
type=
"secondary"
class=
"mt-4"
@
click=
"handleClickLeft"
>
进入团队工作台
</c-button>
</div>
</div>
</main-page>
</main-page>
...
@@ -66,7 +69,6 @@ import { Image } from 'vant'
...
@@ -66,7 +69,6 @@ import { Image } from 'vant'
import
{
formatDate
}
from
'@/util/FormatDate'
import
{
formatDate
}
from
'@/util/FormatDate'
import
VueQr
from
'vue-qr'
import
VueQr
from
'vue-qr'
import
html2canvas
from
'html2canvas'
import
html2canvas
from
'html2canvas'
import
{
CanvasRenderer
}
from
'html2canvas/dist/types/render/canvas/canvas-renderer'
import
{
Department
}
from
'@/Interface'
import
{
Department
}
from
'@/Interface'
interface
JoinInfoType
{
interface
JoinInfoType
{
depId
:
string
depId
:
string
...
@@ -108,7 +110,6 @@ export default Vue.extend({
...
@@ -108,7 +110,6 @@ export default Vue.extend({
this
.
qrCodeText
=
JSON
.
stringify
(
this
.
joinInfo
)
this
.
qrCodeText
=
JSON
.
stringify
(
this
.
joinInfo
)
let
url
=
window
.
location
.
origin
+
'/team/confirm-join'
let
url
=
window
.
location
.
origin
+
'/team/confirm-join'
this
.
qrCodeText
=
`
${
url
}
?
${
urloutput
}
`
this
.
qrCodeText
=
`
${
url
}
?
${
urloutput
}
`
console
.
log
(
this
.
qrCodeText
);
this
.
dpr
()
this
.
dpr
()
// this.drawCanvas()
// this.drawCanvas()
...
...
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