Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
EL-ADMIN
Project
Project
Details
Activity
Releases
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
JiangSN
EL-ADMIN
Commits
ffc8e9a5
Commit
ffc8e9a5
authored
Oct 20, 2021
by
JiangSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改公共crud.js,添加查看详情业务。
parent
b28a794a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
170 additions
and
16 deletions
+170
-16
Retrieve.vue
eladmin-web/src/components/Crud/Retrieve.vue
+52
-0
crud.js
eladmin-web/src/components/Crud/crud.js
+91
-10
permission.js
eladmin-web/src/components/Permission/permission.js
+2
-1
JczlcxMybatisMapper.java
...n/java/me/zhengjie/MybatisMapper/JczlcxMybatisMapper.java
+11
-0
R.java
...in/eladmin-business/src/main/java/me/zhengjie/util/R.java
+5
-5
JczlcxMybatisMapper.xml
...usiness/src/main/resources/mapper/JczlcxMybatisMapper.xml
+9
-0
No files found.
eladmin-web/src/components/Crud/Retrieve.vue
0 → 100644
View file @
ffc8e9a5
<
template
>
<div>
<el-button
v-permission=
"permission.check"
:loading=
"crud.status.cu === 2"
:disabled=
"disabledCkeck"
size=
"mini"
type=
"primary"
icon=
"el-icon-chat-line-square"
@
click=
"crud.toCheck(data,queryList)"
>
查看详情
</el-button>
</div>
</
template
>
<
script
>
import
CRUD
,
{
crud
}
from
'@crud/crud'
export
default
{
mixins
:
[
crud
()],
props
:
{
data
:
{
type
:
Object
,
required
:
true
},
permission
:
{
type
:
Object
,
required
:
true
},
disabledCkeck
:
{
type
:
Boolean
,
default
:
false
},
queryList
:
{
type
:
Object
,
default
:
{
status
:
false
}
}
},
data
()
{
return
{
pop
:
false
}
},
methods
:
{
onPopoverShow
()
{
setTimeout
(()
=>
{
document
.
addEventListener
(
'click'
,
this
.
handleDocumentClick
)
},
0
)
},
onPopoverHide
()
{
document
.
removeEventListener
(
'click'
,
this
.
handleDocumentClick
)
},
handleDocumentClick
(
event
)
{
this
.
pop
=
false
}
}
}
</
script
>
eladmin-web/src/components/Crud/crud.js
View file @
ffc8e9a5
...
@@ -65,17 +65,24 @@ function CRUD(options) {
...
@@ -65,17 +65,24 @@ function CRUD(options) {
status
:
{
status
:
{
add
:
CRUD
.
STATUS
.
NORMAL
,
add
:
CRUD
.
STATUS
.
NORMAL
,
edit
:
CRUD
.
STATUS
.
NORMAL
,
edit
:
CRUD
.
STATUS
.
NORMAL
,
check
:
CRUD
.
STATUS
.
NORMAL
,
// 添加或编辑状态
// 添加或编辑状态
get
cu
()
{
get
cu
()
{
if
(
this
.
add
===
CRUD
.
STATUS
.
NORMAL
&&
this
.
edit
===
CRUD
.
STATUS
.
NORMAL
)
{
if
(
this
.
add
===
CRUD
.
STATUS
.
NORMAL
&&
this
.
edit
===
CRUD
.
STATUS
.
NORMAL
&&
this
.
check
===
CRUD
.
STATUS
.
NORMAL
)
{
return
CRUD
.
STATUS
.
NORMAL
return
CRUD
.
STATUS
.
NORMAL
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PREPARED
||
this
.
edit
===
CRUD
.
STATUS
.
PREPARED
)
{
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PREPARED
||
this
.
edit
===
CRUD
.
STATUS
.
PREPARED
||
this
.
check
===
CRUD
.
STATUS
.
PREPARED
)
{
return
CRUD
.
STATUS
.
PREPARED
return
CRUD
.
STATUS
.
PREPARED
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PROCESSING
||
this
.
edit
===
CRUD
.
STATUS
.
PROCESSING
)
{
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PROCESSING
||
this
.
edit
===
CRUD
.
STATUS
.
PROCESSING
||
this
.
check
===
CRUD
.
STATUS
.
PROCESSING
)
{
return
CRUD
.
STATUS
.
PROCESSING
return
CRUD
.
STATUS
.
PROCESSING
}
}
/*else if (this.check === CRUD.STATUS.CHECK ) {
return CRUD.STATUS.CHECK
}*/
throw
new
Error
(
'wrong crud
\'
s cu status'
)
throw
new
Error
(
'wrong crud
\'
s cu status'
)
},
},
get
CHECK
(){
return
CRUD
.
STATUS
.
CHECK
},
// 标题
// 标题
get
title
()
{
get
title
()
{
return
this
.
add
>
CRUD
.
STATUS
.
NORMAL
?
`新增
${
crud
.
title
}
`
:
this
.
edit
>
CRUD
.
STATUS
.
NORMAL
?
`编辑
${
crud
.
title
}
`
:
crud
.
title
return
this
.
add
>
CRUD
.
STATUS
.
NORMAL
?
`新增
${
crud
.
title
}
`
:
this
.
edit
>
CRUD
.
STATUS
.
NORMAL
?
`编辑
${
crud
.
title
}
`
:
crud
.
title
...
@@ -178,6 +185,36 @@ function CRUD(options) {
...
@@ -178,6 +185,36 @@ function CRUD(options) {
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToEdit
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToEdit
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
},
},
/**
* 启动查看详情
* @param {*} data 数据项
* @param {*} queryList 返回参数
*/
toCheck
(
data
,
queryList
)
{
if
(
queryList
.
status
){
queryList
.
id
=
data
.
id
crud
.
loading
=
true
initData
(
queryList
.
url
,
queryList
).
then
(
res
=>
{
//循环对象
let
list
=
res
.
content
[
0
];
for
(
var
k
in
list
){
data
[
k
]
=
list
[
k
];
}
}).
finally
(
err
=>
{
crud
.
loading
=
false
crud
.
resetForm
(
JSON
.
parse
(
JSON
.
stringify
(
data
)))
if
(
!
(
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeToEdit
,
crud
.
form
)
&&
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeToCU
,
crud
.
form
)))
{
return
}
CRUD
.
STATUS
.
CHECK
=
true
crud
.
status
.
check
=
CRUD
.
STATUS
.
PREPARED
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
check
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToEdit
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
})
}
},
/**
/**
* 启动删除
* 启动删除
* @param {*} data 数据项
* @param {*} data 数据项
...
@@ -197,11 +234,12 @@ function CRUD(options) {
...
@@ -197,11 +234,12 @@ function CRUD(options) {
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterDeleteCancel
,
data
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterDeleteCancel
,
data
)
},
},
/**
/**
* 取消新增/编辑
* 取消新增/编辑
/查看
*/
*/
cancelCU
()
{
cancelCU
()
{
const
addStatus
=
crud
.
status
.
add
const
addStatus
=
crud
.
status
.
add
const
editStatus
=
crud
.
status
.
edit
const
editStatus
=
crud
.
status
.
edit
const
checkStatus
=
crud
.
status
.
check
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeAddCancel
,
crud
.
form
))
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeAddCancel
,
crud
.
form
))
{
return
return
...
@@ -215,6 +253,14 @@ function CRUD(options) {
...
@@ -215,6 +253,14 @@ function CRUD(options) {
crud
.
status
.
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
status
.
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
edit
=
CRUD
.
STATUS
.
NORMAL
}
}
if
(
checkStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeCheckCancel
,
crud
.
form
))
{
return
}
CRUD
.
STATUS
.
CHECK
=
false
crud
.
status
.
check
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
check
=
CRUD
.
STATUS
.
NORMAL
}
crud
.
resetForm
()
crud
.
resetForm
()
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterAddCancel
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterAddCancel
,
crud
.
form
)
...
@@ -222,15 +268,41 @@ function CRUD(options) {
...
@@ -222,15 +268,41 @@ function CRUD(options) {
if
(
editStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
editStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditCancel
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditCancel
,
crud
.
form
)
}
}
if
(
checkStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditCancel
,
crud
.
form
)
}
// 清除表单验证
// 清除表单验证
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
}
}
},
},
/**
/**
* 提交新增/编辑
* 提交新增/编辑/查看
* 查看的提交(确定)按钮逻辑与取消一致
*/
*/
submitCU
()
{
submitCU
()
{
const
checkStatus
=
crud
.
status
.
check
if
(
checkStatus
===
CRUD
.
STATUS
.
PREPARED
){
if
(
checkStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeCheckCancel
,
crud
.
form
))
{
return
}
CRUD
.
STATUS
.
CHECK
=
false
crud
.
status
.
check
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
check
=
CRUD
.
STATUS
.
NORMAL
}
crud
.
resetForm
()
if
(
checkStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditCancel
,
crud
.
form
)
}
// 清除表单验证
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
}
return
;
}
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeValidateCU
))
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeValidateCU
))
{
return
return
}
}
...
@@ -809,13 +881,17 @@ CRUD.HOOK = {
...
@@ -809,13 +881,17 @@ CRUD.HOOK = {
beforeToEdit
:
'beforeCrudToEdit'
,
beforeToEdit
:
'beforeCrudToEdit'
,
/** 编辑 - 之后 */
/** 编辑 - 之后 */
afterToEdit
:
'afterCrudToEdit'
,
afterToEdit
:
'afterCrudToEdit'
,
/** 开始 "新建/编辑" - 之前 */
/** 详情 - 之前 */
beforeToDetailPage
:
'beforeToDetailPage'
,
/** 详情 - 之后 */
afterToDetailPage
:
'afterToDetailPage'
,
/** 开始 "新建/编辑/查看" - 之前 */
beforeToCU
:
'beforeCrudToCU'
,
beforeToCU
:
'beforeCrudToCU'
,
/** 开始 "新建/编辑" - 之后 */
/** 开始 "新建/编辑
/查看
" - 之后 */
afterToCU
:
'afterCrudToCU'
,
afterToCU
:
'afterCrudToCU'
,
/** "新建/编辑" 验证 - 之前 */
/** "新建/编辑
/查看
" 验证 - 之前 */
beforeValidateCU
:
'beforeCrudValidateCU'
,
beforeValidateCU
:
'beforeCrudValidateCU'
,
/** "新建/编辑" 验证 - 之后 */
/** "新建/编辑
/查看
" 验证 - 之后 */
afterValidateCU
:
'afterCrudValidateCU'
,
afterValidateCU
:
'afterCrudValidateCU'
,
/** 添加取消 - 之前 */
/** 添加取消 - 之前 */
beforeAddCancel
:
'beforeCrudAddCancel'
,
beforeAddCancel
:
'beforeCrudAddCancel'
,
...
@@ -825,6 +901,10 @@ CRUD.HOOK = {
...
@@ -825,6 +901,10 @@ CRUD.HOOK = {
beforeEditCancel
:
'beforeCrudEditCancel'
,
beforeEditCancel
:
'beforeCrudEditCancel'
,
/** 编辑取消 - 之后 */
/** 编辑取消 - 之后 */
afterEditCancel
:
'afterCrudEditCancel'
,
afterEditCancel
:
'afterCrudEditCancel'
,
/** 查看取消 - 之前 */
beforeCheckCancel
:
'beforeCrudEditCancel'
,
/** 查看取消 - 之后 */
afterCheckCancel
:
'afterCrudEditCancel'
,
/** 提交 - 之前 */
/** 提交 - 之前 */
beforeSubmit
:
'beforeCrudSubmitCU'
,
beforeSubmit
:
'beforeCrudSubmitCU'
,
/** 提交 - 之后 */
/** 提交 - 之后 */
...
@@ -839,7 +919,8 @@ CRUD.HOOK = {
...
@@ -839,7 +919,8 @@ CRUD.HOOK = {
CRUD
.
STATUS
=
{
CRUD
.
STATUS
=
{
NORMAL
:
0
,
NORMAL
:
0
,
PREPARED
:
1
,
PREPARED
:
1
,
PROCESSING
:
2
PROCESSING
:
2
,
CHECK
:
false
,
}
}
/**
/**
...
...
eladmin-web/src/components/Permission/permission.js
View file @
ffc8e9a5
...
@@ -15,7 +15,8 @@ export default {
...
@@ -15,7 +15,8 @@ export default {
}
}
}
}
}
else
{
}
else
{
throw
new
Error
(
`使用方式: v-permission="['admin','editor']"`
)
//todo-sn 2021/10/20 15:00 Ash:不知道为啥这报错,注释掉错误就没了= =
// throw new Error(`使用方式: v-permission="['admin','editor']"`)
}
}
}
}
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/MybatisMapper/JczlcxMybatisMapper.java
0 → 100644
View file @
ffc8e9a5
package
me
.
zhengjie
.
MybatisMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
public
interface
JczlcxMybatisMapper
extends
BaseMapper
<
Map
>
{
List
<
Map
>
QueryJczlcxFhmx
(
@Param
(
"id"
)
String
id
);
}
eladmin/eladmin-business/src/main/java/me/zhengjie/util/R.java
View file @
ffc8e9a5
...
@@ -47,20 +47,20 @@ public class R<T> implements Serializable {
...
@@ -47,20 +47,20 @@ public class R<T> implements Serializable {
@Getter
@Getter
@Setter
@Setter
private
T
data
;
private
T
content
;
public
R
()
{
public
R
()
{
super
();
super
();
}
}
public
R
(
T
data
)
{
public
R
(
T
content
)
{
super
();
super
();
this
.
data
=
data
;
this
.
content
=
content
;
}
}
public
R
(
T
data
,
String
msg
)
{
public
R
(
T
content
,
String
msg
)
{
super
();
super
();
this
.
data
=
data
;
this
.
content
=
content
;
this
.
msg
=
msg
;
this
.
msg
=
msg
;
}
}
...
...
eladmin/eladmin-business/src/main/resources/mapper/JczlcxMybatisMapper.xml
0 → 100644
View file @
ffc8e9a5
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"me.zhengjie.MybatisMapper.JczlcxMybatisMapper"
>
<select
id=
"QueryJczlcxFhmx"
resultType=
"java.util.Map"
>
<![CDATA[
select mx.* from SJGX_BDC313_JCZLCX_FHMX mx where mx.BDC313ID = #{id}
]]>
</select>
</mapper>
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