Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TF-MOM-WEB
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TFMOM
TF-MOM-WEB
Commits
21136b3d
Commit
21136b3d
authored
Nov 14, 2023
by
“lixuyan”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
站位长选择
parent
6bda104d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
0 deletions
+125
-0
user.js
applications/dee-mes/src/api/user.js
+5
-0
index.vue
...rivateComponents/components/ExtPositionUserLink/index.vue
+120
-0
No files found.
applications/dee-mes/src/api/user.js
0 → 100644
View file @
21136b3d
import
{
get
}
from
'../utils/http'
// 通过用户名或账号模糊匹配查询存在账号的用户
export
function
getUsersByAccount
(
params
)
{
return
get
(
'/DxUserInfo/byAccount'
,
params
)
}
applications/dee-mes/src/privateComponents/components/ExtPositionUserLink/index.vue
0 → 100644
View file @
21136b3d
<
template
>
<div
class=
"ext-position-user-link-com"
>
<el-select
v-model=
"bindValue"
size=
"small"
filterable
multiple
remote
value-key=
"targetId"
:remote-method=
"remoteMethod"
@
change=
"UserChange"
@
remove-tag=
"removeTag"
>
<el-option
v-for=
"citem in UserData"
:key=
"citem.target.id"
:label=
"`$
{citem.target.name}(${citem.target.userAccount})`"
:value="citem"
:disabled="citem.disabled"
/>
</el-select>
</div>
</
template
>
<
script
>
import
{
getUsersByAccount
}
from
'@/api/user'
export
default
{
name
:
'ExtPositionUserLink'
,
componentName
:
'站位长选择'
,
components
:
{},
props
:
{
item
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
},
value
:
{
type
:
Array
,
default
:
()
=>
{
return
[]
}
}
},
data
()
{
return
{
bindValue
:
''
,
UserData
:
[],
removeTags
:
[]
}
},
computed
:
{},
watch
:
{
value
:
{
immediate
:
true
,
deep
:
true
,
handler
:
function
(
val
)
{
if
(
val
)
{
if
(
val
!==
this
.
bindValue
)
{
this
.
bindValue
=
val
.
filter
(
r
=>
r
.
operator
!==
'REMOVE'
)
this
.
removeTags
=
val
.
filter
(
r
=>
r
.
operator
===
'REMOVE'
)
val
.
forEach
(
element
=>
{
element
.
disabled
=
true
})
this
.
UserData
=
this
.
bindValue
}
}
}
}
},
methods
:
{
remoteMethod
(
query
)
{
if
(
query
)
{
const
params
=
{
userAccount
:
query
,
containInnerUser
:
false
}
if
(
this
.
item
.
secret
)
{
params
.
secretCode
=
this
.
$store
.
state
.
user
.
userInfo
.
secretCode
}
getUsersByAccount
(
params
).
then
(
res
=>
{
const
arr
=
[]
this
.
bindValue
.
forEach
(
item
=>
{
arr
.
push
(
item
.
targetId
)
})
if
(
res
.
items
)
{
this
.
UserData
=
res
.
items
.
map
(
element
=>
{
if
(
arr
.
includes
(
element
.
id
))
{
element
.
disabled
=
true
}
else
{
element
.
disabled
=
false
}
return
{
disabled
:
element
.
disabled
,
target
:
element
,
targetId
:
element
.
id
}
})
}
else
{
this
.
UserData
=
[]
}
})
}
else
{
this
.
UserData
=
[]
}
},
UserChange
(
val
)
{
const
arr
=
this
.
removeTags
.
concat
(
val
)
this
.
$emit
(
'input'
,
arr
)
},
removeTag
(
val
)
{
if
(
val
.
sourceId
||
val
.
sourceId
===
0
)
{
this
.
removeTags
.
push
({
...
val
,
operator
:
'REMOVE'
})
const
arr
=
this
.
bindValue
.
concat
(
this
.
removeTags
)
this
.
$emit
(
'input'
,
arr
)
}
}
}
}
</
script
>
<
style
lang=
'scss'
>
</
style
>
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