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
4eff8998
Commit
4eff8998
authored
May 14, 2020
by
蒋勇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d
parent
d4f7452d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
29 deletions
+67
-29
iview-admin/src/view/components/tables/biztables.vue
+38
-22
iview-admin/src/view/components/tables/forms/jsoneditor.vue
+8
-5
iview-admin/src/view/userinfo/orginfo_page.vue
+10
-2
iview-admin/src/view/userinfo/userinfo_page.vue
+11
-0
No files found.
iview-admin/src/view/components/tables/biztables.vue
View file @
4eff8998
<
template
>
<
template
>
<div
style=
"height:100%"
>
<div
style=
"height:100%"
>
<Card
style=
"height:100%"
>
<Card
style=
"height:100%"
>
<Drawer
<Drawer
placement=
"right"
placement=
"right"
...
@@ -68,7 +68,6 @@
...
@@ -68,7 +68,6 @@
v-model=
"showedform"
v-model=
"showedform"
width=
"70"
width=
"70"
@
on-visible-change=
"ondrawvisable"
@
on-visible-change=
"ondrawvisable"
>
>
<Forms
<Forms
ref=
"edform"
ref=
"edform"
...
@@ -170,6 +169,14 @@ export default {
...
@@ -170,6 +169,14 @@ export default {
// return callback();
// return callback();
// };
// };
// }
// }
},
savebefore
:
{
type
:
Function
,
default
(){
return
(
key
,
row
,
cbk
)
=>
{
return
cbk
(
row
)
}
}
}
}
},
},
data
()
{
data
()
{
...
@@ -320,7 +327,9 @@ export default {
...
@@ -320,7 +327,9 @@ export default {
this
.
$emit
(
"onnew"
);
this
.
$emit
(
"onnew"
);
}
}
if
(
key
==
"save"
)
{
if
(
key
==
"save"
)
{
console
.
log
(
"beforevalid........................."
);
console
.
log
(
"beforevalid.........................================================"
);
this
.
$refs
.
edform
.
validate
(
valid
=>
{
this
.
$refs
.
edform
.
validate
(
valid
=>
{
console
.
log
(
"valid........................."
,
valid
);
console
.
log
(
"valid........................."
,
valid
);
if
(
valid
)
{
if
(
valid
)
{
...
@@ -342,22 +351,30 @@ export default {
...
@@ -342,22 +351,30 @@ export default {
}
}
}
}
console
.
log
(
"before.......savbeformdata...............2"
);
console
.
log
(
"before.......savbeformdata...............2"
);
saveFormData
(
url
,
row
).
then
(
res
=>
{
this
.
$nextTick
(()
=>
{
let
rtn
=
res
.
data
;
if
(
this
.
savebefore
)
{
console
.
log
(
rtn
);
this
.
savebefore
(
key
,
row
,
data
=>
{
if
(
rtn
.
status
==
0
)
{
saveFormData
(
url
,
data
).
then
(
res
=>
{
this
.
$refs
.
edform
.
resetForm
();
let
rtn
=
res
.
data
;
this
.
fm_status
=
"normal"
;
console
.
log
(
rtn
);
this
.
showedform
=
false
;
if
(
rtn
.
status
==
0
)
{
this
.
clickcount
[
"save"
]
=
this
.
clickcount
[
"save"
]
-
1
;
this
.
$refs
.
edform
.
resetForm
();
this
.
$Message
.
success
(
msg
);
this
.
fm_status
=
"normal"
;
this
.
showedform
=
false
;
this
.
clickcount
[
"save"
]
=
this
.
clickcount
[
"save"
]
-
1
;
this
.
$Message
.
success
(
msg
);
this
.
fetchData
();
this
.
fetchData
();
}
else
{
}
else
{
this
.
fm_status
=
"normal"
;
this
.
fm_status
=
"normal"
;
this
.
showedform
=
false
;
this
.
showedform
=
false
;
this
.
$Message
.
error
(
"当前操作失败,请稍后重试或联系管理员."
);
this
.
$Message
.
error
(
this
.
fetchData
();
"当前操作失败,请稍后重试或联系管理员."
);
this
.
fetchData
();
}
});
});
}
}
});
});
}
else
{
}
else
{
...
@@ -382,8 +399,7 @@ export default {
...
@@ -382,8 +399,7 @@ export default {
if
(
key
==
"adv-search"
)
{
if
(
key
==
"adv-search"
)
{
this
.
advsearch
();
this
.
advsearch
();
}
}
this
.
$emit
(
"onexec"
,
key
,
row
?
row
:
null
,
btninfo
);
this
.
$emit
(
"onexec"
,
key
,
row
?
row
:
null
,
btninfo
);
},
},
doquery
(
q
,
k
)
{
doquery
(
q
,
k
)
{
if
(
k
==
"cancel-search"
)
{
if
(
k
==
"cancel-search"
)
{
...
@@ -435,8 +451,8 @@ export default {
...
@@ -435,8 +451,8 @@ export default {
}
}
},
},
created
()
{
created
()
{
console
.
log
(
"created.........................................."
)
console
.
log
(
"created.........................................."
);
console
.
log
(
this
.
metainfo
)
console
.
log
(
this
.
metainfo
);
},
},
computed
:
{
computed
:
{
searchinfo
()
{
searchinfo
()
{
...
...
iview-admin/src/view/components/tables/forms/jsoneditor.vue
View file @
4eff8998
<
template
>
<
template
>
<div
id=
"orgcard"
style=
"height:100%"
>
<div
id=
"orgcard"
style=
"height:100%"
>
<Card
style=
"height:100%"
>
<Card
style=
"height:100%"
>
<Alert
type=
"
warning
"
>
<Alert
type=
"
error
"
>
<template
slot=
"desc"
>
<template
slot=
"desc"
>
当前节点:
<Icon
type=
"ios-alert-outline"
/>
双击编辑,单击选择
<br/>
当前节点:
{{
currentData
?
currentData
.
title
:
"请选择操作节点"
}}
{{
currentData
?
currentData
.
title
:
"请选择操作节点"
}}
</
template
>
</
template
>
</Alert>
</Alert>
...
@@ -134,7 +137,7 @@ export default {
...
@@ -134,7 +137,7 @@ export default {
"span"
,
"span"
,
{
{
on
:
{
on
:
{
click
:
()
=>
{
"dblclick"
:
()
=>
{
this
.
onselnode
(
node
,
data
);
this
.
onselnode
(
node
,
data
);
}
}
}
}
...
@@ -170,7 +173,7 @@ export default {
...
@@ -170,7 +173,7 @@ export default {
width
:
"64px"
width
:
"64px"
},
},
on
:
{
on
:
{
click
:
()
=>
{
"click"
:
()
=>
{
this
.
append
(
data
);
this
.
append
(
data
);
}
}
}
}
...
@@ -325,7 +328,7 @@ export default {
...
@@ -325,7 +328,7 @@ export default {
"span"
,
"span"
,
{
{
on
:
{
on
:
{
click
:
$event
=>
{
"dblclick"
:
$event
=>
{
$
(
"span"
,
".ptree"
).
removeClass
(
"spansel"
);
$
(
"span"
,
".ptree"
).
removeClass
(
"spansel"
);
$
(
$event
.
target
)
$
(
$event
.
target
)
.
parent
()
.
parent
()
...
...
iview-admin/src/view/userinfo/orginfo_page.vue
View file @
4eff8998
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
@
controlctl=
"controlctl"
@
controlctl=
"controlctl"
@
drawaction=
"drawaction"
@
drawaction=
"drawaction"
></OrgEditor>
></OrgEditor>
<UserInfo
ref=
"userinfo"
slot=
"right"
></UserInfo>
<UserInfo
ref=
"userinfo"
slot=
"right"
:beforesave=
"beforesave"
></UserInfo>
</SplitPanel>
</SplitPanel>
</div>
</div>
</
template
>
</
template
>
...
@@ -99,12 +99,20 @@ export default {
...
@@ -99,12 +99,20 @@ export default {
});
});
},
},
methods
:
{
methods
:
{
beforesave
(
key
,
row
,
cbk
)
{
//对row添加组织结构需要的字段
if
(
this
.
$refs
.
orgtree
.
currentData
&&
this
.
$refs
.
orgtree
.
currentData
.
isPosition
){
row
.
opath
=
this
.
$refs
.
orgtree
.
currentData
.
orgpath
}
console
.
log
(
"before.save"
,
key
,
row
)
return
cbk
(
row
)
},
setHeight
()
{
setHeight
()
{
let
$orgdiv
=
$
(
"#orgdiv"
);
let
$orgdiv
=
$
(
"#orgdiv"
);
let
el
=
$orgdiv
.
get
()[
0
];
let
el
=
$orgdiv
.
get
()[
0
];
let
h
=
window
.
innerHeight
-
el
.
offsetTop
;
let
h
=
window
.
innerHeight
-
el
.
offsetTop
;
$orgdiv
.
css
(
"height"
,
h
+
"px"
);
$orgdiv
.
css
(
"height"
,
h
+
"px"
);
this
.
$refs
.
userinfo
.
setHeight
(
h
-
120
)
this
.
$refs
.
userinfo
.
setHeight
(
h
-
120
);
},
},
drawaction
(
v
,
fm
)
{
drawaction
(
v
,
fm
)
{
if
(
fm
.
formModel
.
isPosition
)
{
if
(
fm
.
formModel
.
isPosition
)
{
...
...
iview-admin/src/view/userinfo/userinfo_page.vue
View file @
4eff8998
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
isMulti
isMulti
@
onnew=
"onnew"
@
onnew=
"onnew"
@
onedit=
"onedit"
@
onedit=
"onedit"
:savebefore=
"beforesave"
></BizTable>
></BizTable>
</div>
</div>
</
template
>
</
template
>
...
@@ -21,6 +22,16 @@ export default {
...
@@ -21,6 +22,16 @@ export default {
components
:
{
components
:
{
BizTable
BizTable
},
},
props
:{
beforesave
:{
type
:
Function
,
default
(){
return
(
key
,
row
,
cbk
)
=>
{
return
cbk
(
row
)
}
}
}
},
methods
:
{
methods
:
{
setHeight
(
h
){
setHeight
(
h
){
this
.
$refs
.
bt
.
setHeight
(
h
)
this
.
$refs
.
bt
.
setHeight
(
h
)
...
...
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