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
323f3097
Commit
323f3097
authored
Jan 24, 2024
by
“lixuyan”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通用选人组件-账号组件
parent
24937f02
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
256 additions
and
1 deletion
+256
-1
user.js
applications/dee-mes/src/api/user.js
+4
-1
config.js
...eComponents/components/GeneralUserAccountSelect/config.js
+69
-0
index.vue
...eComponents/components/GeneralUserAccountSelect/index.vue
+183
-0
No files found.
applications/dee-mes/src/api/user.js
View file @
323f3097
import
{
get
}
from
'../utils/http'
import
{
get
,
post
}
from
'../utils/http'
// 通过用户名或账号模糊匹配查询存在账号的用户
export
function
getUsersByAccount
(
params
)
{
return
get
(
'/DxUserInfo/byAccount'
,
params
)
}
export
function
getFuzzyMatchUser
(
value
)
{
return
post
(
'/AuditLog/fuzzyMatchUser?value='
+
value
)
}
applications/dee-mes/src/privateComponents/components/GeneralUserAccountSelect/config.js
0 → 100644
View file @
323f3097
export
default
{
props
:
{},
layoutConfigData
:
[
{
title
:
'高级组件配置'
,
data
:
[
{
key
:
'component.multiple'
,
title
:
'多选'
,
disabled
:
false
,
component
:
{
name
:
'el-switch'
}
},
// {
// key: 'secret',
// title: '业务密级',
// disabled: true,
// component: {
// name: 'el-switch'
// }
// },
{
key
:
'containInnerUse'
,
title
:
'是否包含内置用户'
,
disabled
:
true
,
component
:
{
defaultValue
:
false
,
name
:
'el-select'
,
options
:
[
{
'label'
:
'是'
,
'value'
:
true
},
{
'label'
:
'否'
,
'value'
:
false
}
]
}
},
{
key
:
'isAudPage'
,
title
:
'是否为审计面'
,
disabled
:
false
,
component
:
{
defaultValue
:
false
,
name
:
'el-switch'
}
}
]
}
],
data
()
{
return
{
// secretOptions: []
}
},
created
()
{
},
mounted
()
{
// this.$utils.getDicListByCode('SecretCode').then(res => {
// console.log('3333', JSON.stringify(res))
// this.secretOptions = res
// })
},
computed
:
{
},
methods
:
{
}
}
applications/dee-mes/src/privateComponents/components/GeneralUserAccountSelect/index.vue
0 → 100644
View file @
323f3097
/**
* @Description:
* @author cxg
* @date 2022/07/04
*/
<
template
>
<div
class=
"GeneralUserSelect-page"
>
<el-select
v-model=
"bindValue"
size=
"small"
filterable
:multiple=
"isMultiple"
remote
:disabled=
"disabled"
:remote-method=
"remoteMethod"
:loading=
"loading"
@
change=
"UserChange"
>
<el-option
v-for=
"citem in UserData"
:key=
"citem.id"
:label=
"citem.name"
:value=
"citem.userAccount"
/>
</el-select>
</div>
</
template
>
<
script
>
import
{
getUsersByAccount
,
getFuzzyMatchUser
}
from
'@/api/user'
import
config
from
'./config'
export
default
{
name
:
'GeneralUserAccountSelect'
,
components
:
{},
componentName
:
'通用选人组件-账号'
,
mixins
:
[
config
],
props
:
{
item
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
},
basicData
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
},
multiple
:
{
type
:
Boolean
,
default
:
false
},
disabled
:
{
type
:
Boolean
,
default
:
false
},
value
:
{
type
:
[
Object
,
String
,
Array
,
Number
],
default
:
()
=>
{
return
{}
}
}
},
data
()
{
return
{
bindValue
:
''
,
UserData
:
[],
loading
:
false
// secretCode: ''
}
},
computed
:
{
isMultiple
()
{
return
this
.
item
.
multiple
||
this
.
$utils
.
_get
(
this
.
item
,
'component.multiple'
)
||
false
}
},
watch
:
{
// 'item.secret': {
// deep: true,
// handler: function(val) {
// if (val) {
// // getSecretMatrix().then((res) => {
// // const secretCode = []
// // console.log(res.items)
// // if (res.items) {
// // Object.keys(res.items).forEach(i => {
// // if (res.items[i][val]) {
// // secretCode.push(i)
// // }
// // })
// // }
// // this.secretCode = secretCode.join(',')
// // })
// }
// },
// immediate: true
// },
value
:
{
immediate
:
true
,
deep
:
true
,
handler
:
function
(
val
)
{
if
(
val
!==
this
.
bindValue
)
{
if
(
!
val
||
(
this
.
$utils
.
isObect
(
val
)
&&
(
Object
.
keys
(
val
).
length
===
0
)))
{
this
.
bindValue
=
''
}
else
{
this
.
bindValue
=
val
}
if
(
val
||
val
===
0
)
{
let
searchArray
=
[]
if
(
this
.
$utils
.
isObect
(
val
))
{
if
(
val
.
id
)
{
searchArray
=
[
val
.
id
]
}
}
else
if
(
this
.
$utils
.
isNumber
(
val
))
{
searchArray
=
[
val
]
}
else
{
searchArray
=
val
.
split
(
','
)
}
if
(
searchArray
.
length
)
{
const
params
=
{
'pageFrom'
:
1
,
'pageSize'
:
10
,
'searchItems'
:
{
'items'
:
[
{
'fieldName'
:
'id'
,
'operator'
:
'IN'
,
'value'
:
searchArray
}
],
'operator'
:
'AND'
}
}
this
.
$api
.
searchApi
(
'DxUserInfo'
,
params
).
then
(
res
=>
{
this
.
UserData
=
res
.
items
.
content
})
}
}
}
}
}
},
methods
:
{
remoteMethod
(
query
)
{
if
(
query
)
{
// 针对审计页面查人
if
(
this
.
item
.
isAudPage
)
{
this
.
loading
=
true
getFuzzyMatchUser
(
query
)
.
then
(
res
=>
{
this
.
UserData
=
res
.
items
?
res
.
items
:
[]
})
.
finally
(()
=>
{
this
.
loading
=
false
})
}
else
{
// 针对非审计页面查人
const
params
=
{
userAccount
:
query
,
containInnerUser
:
this
.
item
.
containInnerUse
||
false
}
if
(
this
.
item
.
secret
)
{
params
.
secretCode
=
this
.
$store
.
state
.
user
.
userInfo
.
secretCode
}
this
.
loading
=
true
getUsersByAccount
(
params
)
.
then
(
res
=>
{
this
.
UserData
=
res
.
items
?
res
.
items
:
[]
})
.
finally
(()
=>
{
this
.
loading
=
false
})
}
}
},
UserChange
(
val
)
{
this
.
$emit
(
'input'
,
val
)
}
}
}
</
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