Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
daa16013
Commit
daa16013
authored
May 13, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
c385a695
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
253 additions
and
0 deletions
+253
-0
iview-admin/src/router/routers.js
+9
-0
iview-admin/src/view/components/tables/forms/forms.vue
+0
-0
iview-admin/src/view/userinfo/orginfo_page.vue
+244
-0
No files found.
iview-admin/src/router/routers.js
View file @
daa16013
...
...
@@ -127,6 +127,15 @@ export default [
component
:
Main
,
children
:
[
{
path
:
'org_info'
,
name
:
'org_info'
,
meta
:
{
icon
:
'ios-man'
,
title
:
'组织结构'
},
component
:
()
=>
import
(
'@/view/userinfo/orginfo_page.vue'
)
},
{
path
:
'user_info'
,
name
:
'user_info'
,
meta
:
{
...
...
iview-admin/src/view/components/tables/forms/forms.vue
View file @
daa16013
This diff is collapsed.
Click to expand it.
iview-admin/src/view/userinfo/orginfo_page.vue
0 → 100644
View file @
daa16013
<
template
>
<div
id=
"orgcard"
>
<Card
style=
"height:100%"
>
<Tree
:data=
"treedata"
:render=
"renderContent"
class=
"ptree"
show-checkbox
></Tree>
<Drawer
ref=
"eddrawer"
placement=
"right"
:closable=
"false"
:mask-closable=
"false"
v-model=
"showedform"
width=
"70"
@
on-visible-change=
"ondrawvisable"
>
<NodeForm
ref=
"nodeform"
:fminfo=
"nodeinfo"
>
<template
v-slot:default=
"slotProps"
>
<Button
type=
"text"
@
click=
"doexec('ok',slotProps.fm)"
>
确定
</Button>
<Button
type=
"text"
@
click=
"doexec('cancel',slotProps.fm)"
>
取消
</Button>
</
template
>
</NodeForm>
</Drawer>
</Card>
</div>
</template>
<
script
>
import
{
getApp
,
saveAuths
,
findAuthsByRoles
}
from
"@/api/meta"
;
import
NodeForm
from
"@/view/components/tables/forms/forms.vue"
;
import
config
from
"@/config"
;
export
default
{
name
:
"treeinfo_page"
,
components
:
{
NodeForm
},
data
()
{
return
{
treedata
:
[],
showedform
:
false
,
buttonProps
:
{
type
:
"default"
,
size
:
"small"
},
nodeinfo
:
{
name
:
"节点编辑"
,
main
:
[
{
title
:
"基本信息"
,
key
:
"baseinfo"
,
cols
:
1
,
ctls
:
[
{
type
:
"input"
,
label
:
"标题"
,
prop
:
"title"
,
placeHolder
:
"请输入节点标题"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]},
{
type
:
"input"
,
label
:
"编码"
,
prop
:
"code"
,
placeHolder
:
"请输入编码"
,
style
:
""
,
rules
:
[{
required
:
true
,
message
:
" "
,
trigger
:
"blur"
}]},
{
"type"
:
"model-select"
,
"refModel"
:
"auth.role"
,
"isMulti"
:
true
,
"label"
:
"角色"
,
"prop"
:
"roles"
,
"labelField"
:
"name"
,
"valueField"
:
"id"
,
"style"
:{
"margin-left"
:
"10px"
,
width
:
"165px"
}},
]
}
],
lists
:
null
}
};
},
mounted
()
{
this
.
setHeight
();
$
(
window
).
resize
(()
=>
{
this
.
setHeight
();
});
this
.
initTree
();
},
methods
:
{
ondrawvisable
(){
},
doexec
(
k
,
fm
){
console
.
log
(
fm
)
if
(
k
==
"ok"
){
this
.
showedform
=
false
}
else
{
this
.
showedform
=
false
}
},
buildNodeData
(){
},
onselnode
(
ns
,
n
){
this
.
showedform
=
true
},
initTree
()
{
this
.
treedata
=
[
{
title
:
"自定义结构树"
,
expand
:
true
,
render
:
(
h
,
{
root
,
node
,
data
})
=>
{
return
h
(
"span"
,
{
style
:
{
display
:
"inline-block"
,
width
:
"100%"
},
on
:{
click
:()
=>
{
this
.
onselnode
(
node
,
data
)
}
}
},
[
h
(
"span"
,
[
h
(
"Icon"
,
{
props
:
{
type
:
"ios-folder-outline"
},
style
:
{
marginRight
:
"8px"
}
}),
h
(
"span"
,
data
.
title
)
]),
h
(
"span"
,
{
style
:
{
display
:
"inline-block"
,
float
:
"right"
,
marginRight
:
"32px"
}
},
[
h
(
"Button"
,
{
props
:
Object
.
assign
({},
this
.
buttonProps
,
{
icon
:
"ios-add"
,
type
:
"primary"
}),
style
:
{
width
:
"64px"
},
on
:
{
click
:
()
=>
{
this
.
append
(
data
);
}
}
})
]
)
]
);
},
children
:
[]
}
];
},
setHeight
()
{
let
$orgcard
=
$
(
"#orgcard"
);
let
el
=
$orgcard
.
get
()[
0
];
let
h
=
window
.
innerHeight
-
el
.
offsetTop
-
30
;
$orgcard
.
css
(
"height"
,
h
+
"px"
);
},
renderContent
(
h
,
{
root
,
node
,
data
})
{
return
h
(
"span"
,
{
style
:
{
display
:
"inline-block"
,
width
:
"100%"
}
},
[
h
(
"span"
,
[
h
(
"Icon"
,
{
props
:
{
type
:
"ios-paper-outline"
},
style
:
{
marginRight
:
"8px"
}
}),
h
(
"span"
,
data
.
title
)
]),
h
(
"span"
,
{
style
:
{
display
:
"inline-block"
,
float
:
"right"
,
marginRight
:
"32px"
}
},
[
h
(
"Button"
,
{
props
:
Object
.
assign
({},
this
.
buttonProps
,
{
icon
:
"ios-add"
}),
style
:
{
marginRight
:
"8px"
},
on
:
{
click
:
()
=>
{
this
.
append
(
data
);
}
}
}),
h
(
"Button"
,
{
props
:
Object
.
assign
({},
this
.
buttonProps
,
{
icon
:
"ios-remove"
}),
on
:
{
click
:
()
=>
{
this
.
remove
(
root
,
node
,
data
);
}
}
})
]
)
]
);
},
append
(
data
)
{
const
children
=
data
.
children
||
[];
children
.
push
({
title
:
"appended node"
,
expand
:
true
});
this
.
$set
(
data
,
"children"
,
children
);
},
remove
(
root
,
node
,
data
)
{
const
parentKey
=
root
.
find
(
el
=>
el
===
node
).
parent
;
const
parent
=
root
.
find
(
el
=>
el
.
nodeKey
===
parentKey
).
node
;
const
index
=
parent
.
children
.
indexOf
(
data
);
parent
.
children
.
splice
(
index
,
1
);
}
}
};
</
script
>
<
style
>
.ptree
span
:hover
{
background-color
:
lightgray
;
}
.spansel
{
background-color
:
lightgray
;
}
</
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