Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
杨明
/
scrm-micro-config
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 5f3d21a4
authored
Nov 12, 2021
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
商户名称选择框去掉过滤方法
1 parent
104ded86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
27 deletions
src/views/role/create.vue
src/views/role/index.vue
src/views/role/create.vue
View file @
5f3d21a
...
...
@@ -7,8 +7,8 @@
<div
class=
"main_widget"
>
<el-form
:model=
"ruleForm"
:rules=
"rules"
ref=
"ruleForm"
label-width=
"100px"
class=
"demo-ruleForm"
>
<el-form-item
v-if=
"pageType == 'create'"
label=
"所属商户"
prop=
"merchantId"
>
<el-select
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.merchantId"
:filter-method=
"filterList"
clearable
filterable
placeholder=
"请选择"
@
change=
"selectMerchant"
>
<el-option
v-for=
"item in
l
ist"
:key=
"item.id"
:label=
"item.merchantName"
:value=
"item.id"
></el-option>
<el-select
size=
"small"
style=
"width: 40%"
v-model=
"ruleForm.merchantId"
clearable
filterable
placeholder=
"请选择"
@
change=
"selectMerchant"
>
<el-option
v-for=
"item in
merchantL
ist"
:key=
"item.id"
:label=
"item.merchantName"
:value=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"所属商户"
prop=
"merchantName"
v-if=
"pageType == 'edit'"
>
...
...
@@ -105,7 +105,7 @@ export default {
pageType
:
'create'
,
accountList
:
[],
//商户
l
ist
:
[],
merchantL
ist
:
[],
// tree数据
treeDataList
:
[],
accountLevel
:
1
...
...
@@ -145,20 +145,20 @@ export default {
getMerchantName
()
{
this
.
$apis
.
role
.
merchantDataList
({
source
:
'glsx'
}).
then
(
res
=>
{
this
.
merchantList
=
res
this
.
filterList
()
//
this.filterList()
})
},
// 过滤数据
filterList
(
query
=
''
)
{
let
arr
=
this
.
merchantList
.
filter
(
item
=>
{
return
item
.
merchantName
.
includes
(
query
)
})
if
(
arr
.
length
>
100
)
{
this
.
list
=
arr
.
slice
(
0
,
100
)
}
else
{
this
.
list
=
arr
}
},
//
filterList(query = '') {
//
let arr = this.merchantList.filter(item => {
//
return item.merchantName.includes(query)
//
})
//
if (arr.length > 100) {
//
this.list = arr.slice(0, 100)
//
} else {
//
this.list = arr
//
}
//
},
// 选择商户----获取权限
async
selectMerchant
(
id
)
{
let
res
=
await
this
.
$refs
.
productFrom
.
findMenuFunTreeByMerId
({
id
})
...
...
src/views/role/index.vue
View file @
5f3d21a
...
...
@@ -8,8 +8,8 @@
<div
class=
"left_wrap"
>
<div
v-if=
"accountLevel != 4"
class=
"top_select"
>
<span
class=
"select_label"
>
商户名称
</span>
<el-select
:filter-method=
"filterList"
size=
"small"
clearable
filterable
v-model=
"searchForm.merchantId"
placeholder=
"请选择"
>
<el-option
v-for=
"item in
l
ist"
:key=
"item.id"
:label=
"item.merchantName"
:value=
"item.id"
></el-option>
<el-select
size=
"small"
clearable
filterable
v-model=
"searchForm.merchantId"
placeholder=
"请选择"
>
<el-option
v-for=
"item in
merchantL
ist"
:key=
"item.id"
:label=
"item.merchantName"
:value=
"item.id"
></el-option>
</el-select>
</div>
<div
class=
"top_select"
>
...
...
@@ -140,20 +140,20 @@ export default {
getMerchantName
()
{
this
.
$apis
.
role
.
merchantDataList
({
source
:
'glsx'
}).
then
(
res
=>
{
this
.
merchantList
=
res
this
.
filterList
()
//
this.filterList()
})
},
// 过滤数据
filterList
(
query
=
''
)
{
let
arr
=
this
.
merchantList
.
filter
(
item
=>
{
return
item
.
merchantName
.
includes
(
query
)
})
if
(
arr
.
length
>
100
)
{
this
.
list
=
arr
.
slice
(
0
,
100
)
}
else
{
this
.
list
=
arr
}
},
//
filterList(query = '') {
//
let arr = this.merchantList.filter(item => {
//
return item.merchantName.includes(query)
//
})
//
if (arr.length > 100) {
//
this.list = arr.slice(0, 100)
//
} else {
//
this.list = arr
//
}
//
},
// 查询
toFindData
()
{
this
.
getTableData
()
...
...
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