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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
76 deletions
linkwe-pc/src/components/SelectPost.vue
linkwe-pc/src/components/SelectPost.vue
View file @
6c8e6d7
<
script
>
import
{
getDeptUserAll
}
from
'@/api/organization'
export
default
{
name
:
'SelectPost'
,
components
:
{},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
,
},
title
:
{
type
:
String
,
default
:
'选择岗位'
,
},
// 是否单选
isSigleSelect
:
{
type
:
Boolean
,
default
:
false
,
},
// 默认选中
defaultValues
:
{
type
:
Array
,
default
:
()
=>
[],
},
// 禁止选中
disabledValues
:
{
type
:
Array
,
default
:
()
=>
[],
},
destroyOnClose
:
Boolean
,
},
data
()
{
return
{
postList
:
[],
selectList
:
[],
}
},
watch
:
{
defaultValues
:
{
handler
(
value
)
{
this
.
selectList
=
value
import
{
getDeptUserAll
}
from
'@/api/organization'
export
default
{
name
:
'SelectPost'
,
components
:
{},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
title
:
{
type
:
String
,
default
:
'选择岗位'
},
// 是否单选
isSigleSelect
:
{
type
:
Boolean
,
default
:
false
},
// 默认选中
defaultValues
:
{
type
:
Array
,
default
:
()
=>
[]
},
immediate
:
true
,
// 禁止选中
disabledValues
:
{
type
:
Array
,
default
:
()
=>
[]
},
destroyOnClose
:
Boolean
},
Pvisible
(
val
)
{
this
.
selectList
=
this
.
defaultValues
data
()
{
return
{
postList
:
[],
selectList
:
[]
}
},
},
computed
:
{
Pvisible
:
{
get
()
{
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
watch
:
{
defaultValues
:
{
handler
(
value
)
{
this
.
selectList
=
value
},
immediate
:
true
},
Pvisible
(
val
)
{
this
.
selectList
=
this
.
defaultValues
}
},
},
created
()
{
getDeptUserAll
().
then
(({
data
})
=>
{
this
.
postList
=
data
.
map
((
item
)
=>
{
return
item
.
position
})
})
},
mounted
()
{},
methods
:
{
// 确 定
submit
()
{
this
.
Pvisible
=
false
this
.
$emit
(
'success'
,
[...
this
.
selectList
])
computed
:
{
Pvisible
:
{
get
()
{
return
this
.
visible
},
set
(
val
)
{
this
.
$emit
(
'update:visible'
,
val
)
}
}
},
// 取消选择
cancle
(
index
)
{
this
.
selectList
.
splice
(
index
,
1
)
created
()
{
getDeptUserAll
().
then
(({
data
})
=>
{
let
arr
=
data
.
map
((
item
)
=>
{
return
item
.
position
})
this
.
postList
=
Array
.
from
(
new
Set
(
arr
))
})
},
},
}
mounted
()
{},
methods
:
{
// 确 定
submit
()
{
this
.
Pvisible
=
false
this
.
$emit
(
'success'
,
[...
this
.
selectList
])
},
// 取消选择
cancle
(
index
)
{
this
.
selectList
.
splice
(
index
,
1
)
}
}
}
</
script
>
<
template
>
<el-dialog
:title=
"title"
:visible
.
sync=
"Pvisible"
:close-on-click-modal=
"false"
:destroy-on-close=
"destroyOnClose"
>
...
...
@@ -85,11 +86,12 @@ export default {
<el-checkbox-group
v-model=
"selectList"
>
<template
v-for=
"(unit, index) in postList"
>
<el-checkbox
style=
"display: block"
style=
"display: block
;
"
:label=
"unit"
v-if=
"unit"
:key=
"index"
:disabled=
"disabledValues.includes(unit)"
>
:disabled=
"disabledValues.includes(unit)"
>
{{
unit
}}
</el-checkbox>
</
template
>
...
...
@@ -113,9 +115,9 @@ export default {
</template>
<
style
lang=
"scss"
scoped
>
.user-list
{
.el-row
{
line-height
:
26px
;
.user-list
{
.el-row
{
line-height
:
26px
;
}
}
}
</
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