Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-account
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 cc98787f
authored
Aug 13, 2021
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
bug修复
1 parent
e363e191
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
24 deletions
src/views/productManage/components/SelectTree.vue
src/views/productManage/functionList/index.vue
src/views/productManage/menuList/index.vue
src/views/productManage/components/SelectTree.vue
View file @
cc98787
...
...
@@ -5,6 +5,7 @@
ref=
"popover"
placement=
"bottom-start"
trigger=
"click"
v-model=
"popoverVisible"
:disabled=
"targetItem.isDisabled"
@
show=
"onShowPopover"
@
hide=
"onHidePopover"
...
...
@@ -15,6 +16,7 @@
highlight-current
default-expand-all
node-key=
"id"
:expand-on-click-node=
"isExpand"
:style=
"`min-width: $
{treeWidth}`"
:data="treeData"
:current-node-key="form[targetItem.name]"
...
...
@@ -29,7 +31,7 @@
clearable
:disabled=
"targetItem.isDisabled"
:style=
"`width: $
{width}px`"
:class="{ 'rotate':
showStatus
}"
:class="{ 'rotate':
popoverVisible
}"
suffix-icon="el-icon-arrow-down"
:placeholder="'请选择' + targetItem.label"
@change="handleClear"
...
...
@@ -44,8 +46,9 @@ export default {
name
:
'SelectTree'
,
data
()
{
return
{
isExpand
:
false
,
// 树状菜单显示状态
showStatus
:
false
,
popoverVisible
:
false
,
treeWidth
:
'auto'
}
},
...
...
@@ -108,12 +111,12 @@ export default {
methods
:
{
// 显示时触发
onShowPopover
()
{
this
.
showStatus
=
true
this
.
popoverVisible
=
true
this
.
$refs
.
tree
.
filter
(
false
)
},
// 隐藏时触发
onHidePopover
()
{
this
.
showStatus
=
false
this
.
popoverVisible
=
false
},
// 树节点过滤方法
handleFilterNode
(
query
,
data
)
{
...
...
@@ -122,9 +125,11 @@ export default {
},
handleNodeClick
(
val
)
{
this
.
$emit
(
'selected'
,
{
val
:
val
,
targetItem
:
this
.
targetItem
,
formName
:
this
.
targetItem
.
formName
})
this
.
onHidePopover
()
},
handleClear
(
val
)
{
this
.
$emit
(
'selected'
,
{
val
:
val
,
targetItem
:
this
.
targetItem
,
formName
:
this
.
targetItem
.
formName
})
window
.
event
.
stopPropagation
()
},
// 搜索树状数据中的 ID
queryTree
(
tree
,
id
)
{
...
...
src/views/productManage/functionList/index.vue
View file @
cc98787
...
...
@@ -127,7 +127,6 @@ export default {
searchForm
:
{
functionName
:
''
,
merchantName
:
''
,
ownCus
:
1
,
menuIds
:
''
,
menuName
:
''
,
ownedCusgroupType
:
''
,
...
...
@@ -148,23 +147,29 @@ export default {
label
:
'产品'
,
name
:
'productId'
,
type
:
'select'
,
multiple
:
true
,
//
multiple: true,
optionList
:
[],
optionId
:
'dictValue'
,
optionLabel
:
'dictLabel'
,
optionsName
:
'productList'
,
changeAttr
:
(
value
,
targetItem
)
=>
{
if
(
value
.
includes
(
''
))
{
this
.
searchForm
[
targetItem
.
name
]
=
!
this
.
oldVal
[
targetItem
.
name
].
includes
(
''
)
?
targetItem
.
optionList
.
map
(
item
=>
item
[
targetItem
.
optionId
])
:
this
.
searchForm
[
targetItem
.
name
].
filter
(
item
=>
item
!==
''
)
}
else
{
if
(
this
.
oldVal
[
targetItem
.
name
].
includes
(
''
))
{
this
.
searchForm
[
targetItem
.
name
]
=
[]
}
else
if
(
value
.
length
===
(
targetItem
.
optionList
.
length
-
1
))
{
this
.
searchForm
[
targetItem
.
name
].
push
(
''
)
}
}
this
.
oldVal
[
targetItem
.
name
]
=
this
.
searchForm
[
targetItem
.
name
]
this
.
tableSearchForm
[
targetItem
.
name
]
=
this
.
searchForm
[
targetItem
.
name
].
includes
(
''
)
?
[]
:
this
.
searchForm
[
targetItem
.
name
]
this
.
searchForm
.
menuIds
=
''
this
.
searchForm
.
parentName
=
''
value
&&
baseApi
.
getMenuTree
({
productId
:
value
}).
then
(
res
=>
{
this
.
baseData
.
searchMenuTreeList
=
res
.
data
this
.
getOptionsList
(
'searchFormData'
)
})
// if (value.includes('')) {
// this.searchForm[targetItem.name] = !this.oldVal[targetItem.name].includes('') ? targetItem.optionList.map(item => item[targetItem.optionId]) : this.searchForm[targetItem.name].filter(item => item !== '')
// } else {
// if (this.oldVal[targetItem.name].includes('')) {
// this.searchForm[targetItem.name] = []
// } else if (value.length === (targetItem.optionList.length - 1)) {
// this.searchForm[targetItem.name].push('')
// }
// }
// this.oldVal[targetItem.name] = this.searchForm[targetItem.name]
// this.tableSearchForm[targetItem.name] = this.searchForm[targetItem.name].includes('') ? [] : this.searchForm[targetItem.name]
}
},
{
label
:
'菜单'
,
...
...
@@ -227,8 +232,8 @@ export default {
label
:
'所属客户群体'
,
prop
:
'ownedGroupName'
},
{
label
:
'
创建
时间'
,
prop
:
'
cre
atedTime'
label
:
'
更新
时间'
,
prop
:
'
upd
atedTime'
}]
},
// 弹窗
...
...
@@ -402,9 +407,9 @@ export default {
},
mounted
()
{
baseApi
.
getMenuTree
().
then
(
res
=>
{
this
.
baseData
.
searchMenuTreeList
=
res
.
data
})
//
baseApi.getMenuTree().then(res => {
//
this.baseData.searchMenuTreeList = res.data
//
})
this
.
getBaseData
().
then
(
res
=>
{
this
.
getOptionsList
(
'searchFormData'
)
this
.
getOptionsList
(
'editFormData'
,
false
)
...
...
@@ -462,7 +467,7 @@ export default {
},
getParams
()
{
var
params
=
_
.
cloneDeep
(
this
.
searchForm
)
params
.
productId
.
includes
(
''
)
&&
(
params
.
productId
=
[])
//
params.productId.includes('') && (params.productId = [])
const
tempParams
=
this
.
getSelectInputParams
()
params
=
{
...
params
,
...
...
src/views/productManage/menuList/index.vue
View file @
cc98787
...
...
@@ -183,7 +183,7 @@ export default {
prop
:
'productName'
},
{
label
:
'更新时间'
,
prop
:
'
cre
atedTime'
prop
:
'
upd
atedTime'
}]
},
// 弹窗
...
...
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