Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6c8e6d7d
authored
Jun 27, 2023
by
怪兽?别跑
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
岗位组件调整
1 parent
f8b6e631
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
linkwe-pc/src/components/SelectPost.vue
linkwe-pc/src/components/SelectPost.vue
View file @
6c8e6d7
<
script
>
<
script
>
import
{
getDeptUserAll
}
from
'@/api/organization'
import
{
getDeptUserAll
}
from
'@/api/organization'
export
default
{
export
default
{
name
:
'SelectPost'
,
name
:
'SelectPost'
,
components
:
{},
components
:
{},
props
:
{
props
:
{
visible
:
{
visible
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
},
},
title
:
{
title
:
{
type
:
String
,
type
:
String
,
default
:
'选择岗位'
,
default
:
'选择岗位'
},
},
// 是否单选
// 是否单选
isSigleSelect
:
{
isSigleSelect
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
,
default
:
false
},
},
// 默认选中
// 默认选中
defaultValues
:
{
defaultValues
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[],
default
:
()
=>
[]
},
},
// 禁止选中
// 禁止选中
disabledValues
:
{
disabledValues
:
{
type
:
Array
,
type
:
Array
,
default
:
()
=>
[],
default
:
()
=>
[]
},
},
destroyOnClose
:
Boolean
,
destroyOnClose
:
Boolean
},
},
data
()
{
data
()
{
return
{
return
{
postList
:
[],
postList
:
[],
selectList
:
[],
selectList
:
[]
}
}
},
},
watch
:
{
watch
:
{
...
@@ -40,11 +40,11 @@ export default {
...
@@ -40,11 +40,11 @@ export default {
handler
(
value
)
{
handler
(
value
)
{
this
.
selectList
=
value
this
.
selectList
=
value
},
},
immediate
:
true
,
immediate
:
true
},
},
Pvisible
(
val
)
{
Pvisible
(
val
)
{
this
.
selectList
=
this
.
defaultValues
this
.
selectList
=
this
.
defaultValues
},
}
},
},
computed
:
{
computed
:
{
Pvisible
:
{
Pvisible
:
{
...
@@ -53,14 +53,15 @@ export default {
...
@@ -53,14 +53,15 @@ export default {
},
},
set
(
val
)
{
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
this
.
$emit
(
'update:visible'
,
val
)
},
}
},
}
},
},
created
()
{
created
()
{
getDeptUserAll
().
then
(({
data
})
=>
{
getDeptUserAll
().
then
(({
data
})
=>
{
this
.
postList
=
data
.
map
((
item
)
=>
{
let
arr
=
data
.
map
((
item
)
=>
{
return
item
.
position
return
item
.
position
})
})
this
.
postList
=
Array
.
from
(
new
Set
(
arr
))
})
})
},
},
mounted
()
{},
mounted
()
{},
...
@@ -73,9 +74,9 @@ export default {
...
@@ -73,9 +74,9 @@ export default {
// 取消选择
// 取消选择
cancle
(
index
)
{
cancle
(
index
)
{
this
.
selectList
.
splice
(
index
,
1
)
this
.
selectList
.
splice
(
index
,
1
)
},
}
},
}
}
}
</
script
>
</
script
>
<
template
>
<
template
>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
:close-on-click-modal=
"false"
:destroy-on-close=
"destroyOnClose"
>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
:close-on-click-modal=
"false"
:destroy-on-close=
"destroyOnClose"
>
...
@@ -85,11 +86,12 @@ export default {
...
@@ -85,11 +86,12 @@ export default {
<el-checkbox-group
v-model=
"selectList"
>
<el-checkbox-group
v-model=
"selectList"
>
<template
v-for=
"(unit, index) in postList"
>
<template
v-for=
"(unit, index) in postList"
>
<el-checkbox
<el-checkbox
style=
"display: block"
style=
"display: block
;
"
:label=
"unit"
:label=
"unit"
v-if=
"unit"
v-if=
"unit"
:key=
"index"
:key=
"index"
:disabled=
"disabledValues.includes(unit)"
>
:disabled=
"disabledValues.includes(unit)"
>
{{
unit
}}
{{
unit
}}
</el-checkbox>
</el-checkbox>
</
template
>
</
template
>
...
@@ -113,9 +115,9 @@ export default {
...
@@ -113,9 +115,9 @@ export default {
</template>
</template>
<
style
lang=
"scss"
scoped
>
<
style
lang=
"scss"
scoped
>
.user-list
{
.user-list
{
.el-row
{
.el-row
{
line-height
:
26px
;
line-height
:
26px
;
}
}
}
}
</
style
>
</
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment