Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-operation-4
Overview
Overview
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
达摩4.0重构
haoban-operation-4
Commits
6d5d5383
Commit
6d5d5383
authored
Jul 28, 2020
by
caoyanzhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新建、编辑操作项选择节点
parent
9e3b25b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
operation-table.vue
src/views/permission/operation-list/operation-table.vue
+27
-4
No files found.
src/views/permission/operation-list/operation-table.vue
View file @
6d5d5383
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
<el-dialog
:visible
.
sync=
"editOperation.show"
:title=
"editOperation.operationItemId ? '编辑操作项' : '新建操作项'"
width=
"590px"
@
closed=
"onEditOperationClose"
>
<el-dialog
:visible
.
sync=
"editOperation.show"
:title=
"editOperation.operationItemId ? '编辑操作项' : '新建操作项'"
width=
"590px"
@
closed=
"onEditOperationClose"
>
<el-form
:model=
"editOperation"
:rules=
"editOperationRule"
ref=
"editOperation"
label-width=
"110px"
>
<el-form
:model=
"editOperation"
:rules=
"editOperationRule"
ref=
"editOperation"
label-width=
"110px"
>
<el-form-item
label=
"节点"
prop=
"menuId"
>
<el-form-item
label=
"节点"
prop=
"menuId"
>
<el-select
v-model=
"editOperation.menuId"
style=
"width: 440px"
></el-select
>
<el-cascader
v-model=
"editOperation.menuId"
:options=
"menuList"
:props=
"{ checkStrictly: true, label: 'menuName', value: 'menuId' }"
style=
"width: 440px"
clearable
></el-cascader
>
</el-form-item>
</el-form-item>
<el-form-item
label=
"节点code"
>
<el-form-item
label=
"节点code"
>
<el-input
:value=
"editOperation.menuCode"
style=
"width:440px"
disabled
></el-input>
<el-input
:value=
"editOperation.menuCode"
style=
"width:440px"
disabled
></el-input>
...
@@ -102,6 +102,10 @@ export default {
...
@@ -102,6 +102,10 @@ export default {
},
},
data
()
{
data
()
{
return
{
return
{
// 节点列表
menuList
:
[],
// 平铺的节点列表
flatMenuList
:
[],
search
:
''
,
search
:
''
,
// 分页相关的数据
// 分页相关的数据
pager
:
{
pager
:
{
...
@@ -117,7 +121,7 @@ export default {
...
@@ -117,7 +121,7 @@ export default {
show
:
false
,
show
:
false
,
loading
:
false
,
loading
:
false
,
operationItemId
:
''
,
operationItemId
:
''
,
menuId
:
''
,
menuId
:
[]
,
menuCode
:
''
,
menuCode
:
''
,
operationItemName
:
''
,
operationItemName
:
''
,
operationItemCode
:
''
,
operationItemCode
:
''
,
...
@@ -178,7 +182,7 @@ export default {
...
@@ -178,7 +182,7 @@ export default {
Object
.
assign
(
this
.
editOperation
,
{
Object
.
assign
(
this
.
editOperation
,
{
show
:
true
,
show
:
true
,
operationItemId
,
operationItemId
,
menuId
,
menuId
:
getFullId
(
this
.
flatMenuList
,
menuId
)
,
menuCode
,
menuCode
,
operationItemName
,
operationItemName
,
operationItemCode
,
operationItemCode
,
...
@@ -187,6 +191,16 @@ export default {
...
@@ -187,6 +191,16 @@ export default {
roleRange
:
typeof
roleRange
==
'undefined'
?
'1'
:
roleRange
,
roleRange
:
typeof
roleRange
==
'undefined'
?
'1'
:
roleRange
,
version
version
});
});
function
getFullId
(
menuList
,
menuId
)
{
let
result
=
[
menuId
];
menuList
.
some
(
el
=>
{
if
(
el
.
menuId
==
menuId
&&
el
.
parentId
>
0
)
{
result
=
getFullId
(
menuList
,
el
.
parentId
).
concat
(
result
);
}
return
el
.
menuId
==
menuId
})
return
result
;
}
},
},
// 新建、编辑操作项 弹窗关闭
// 新建、编辑操作项 弹窗关闭
onEditOperationClose
()
{
onEditOperationClose
()
{
...
@@ -209,7 +223,16 @@ export default {
...
@@ -209,7 +223,16 @@ export default {
this
.
$refs
.
editOperation
.
validate
(
vali
=>
{
this
.
$refs
.
editOperation
.
validate
(
vali
=>
{
if
(
!
vali
)
return
;
if
(
!
vali
)
return
;
const
{
operationItemId
,
menuId
,
menuCode
,
operationItemName
,
operationItemCode
,
operationItemUrl
,
authItemFlag
,
roleRange
,
version
,
appType
}
=
this
.
editOperation
;
const
{
operationItemId
,
menuId
,
menuCode
,
operationItemName
,
operationItemCode
,
operationItemUrl
,
authItemFlag
,
roleRange
,
version
,
appType
}
=
this
.
editOperation
;
const
params
=
{
menuId
,
menuCode
,
operationItemName
,
operationItemCode
,
operationItemUrl
,
authItemFlag
,
roleRange
,
version
}
const
params
=
{
menuId
:
Array
.
isArray
(
menuId
)
&&
menuId
.
length
>
0
?
menuId
[
menuId
.
length
-
1
]
:
''
,
menuCode
,
operationItemName
,
operationItemCode
,
operationItemUrl
,
authItemFlag
,
roleRange
,
version
}
this
.
editOperation
.
loading
=
true
;
this
.
editOperation
.
loading
=
true
;
if
(
operationItemId
)
{
if
(
operationItemId
)
{
...
...
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