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
7704443a
Commit
7704443a
authored
Oct 12, 2021
by
井熙铎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初步加文件,加页面
parent
27e189a3
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
3543 additions
and
0 deletions
+3543
-0
CRUD.operation.vue
eladmin-web/src/views/polling/jczlcx/Crud/CRUD.operation.vue
+204
-0
Pagination.vue
eladmin-web/src/views/polling/jczlcx/Crud/Pagination.vue
+18
-0
RR.operation.vue
eladmin-web/src/views/polling/jczlcx/Crud/RR.operation.vue
+20
-0
UD.operation.vue
eladmin-web/src/views/polling/jczlcx/Crud/UD.operation.vue
+74
-0
crud.js
eladmin-web/src/views/polling/jczlcx/Crud/crud.js
+863
-0
index.vue
eladmin-web/src/views/polling/jczlcx/index.vue
+228
-0
CRUD.operation.vue
eladmin-web/src/views/polling/lxjcjy/Crud/CRUD.operation.vue
+204
-0
Pagination.vue
eladmin-web/src/views/polling/lxjcjy/Crud/Pagination.vue
+18
-0
RR.operation.vue
eladmin-web/src/views/polling/lxjcjy/Crud/RR.operation.vue
+20
-0
UD.operation.vue
eladmin-web/src/views/polling/lxjcjy/Crud/UD.operation.vue
+74
-0
crud.js
eladmin-web/src/views/polling/lxjcjy/Crud/crud.js
+863
-0
index.vue
eladmin-web/src/views/polling/lxjcjy/index.vue
+228
-0
JczlcxController.java
...rc/main/java/me/zhengjie/controller/JczlcxController.java
+86
-0
LxjcjyController.java
...rc/main/java/me/zhengjie/controller/LxjcjyController.java
+86
-0
JczlcxDeploy.java
...erface/src/main/java/me/zhengjie/domain/JczlcxDeploy.java
+119
-0
LxjcjyDeploy.java
...erface/src/main/java/me/zhengjie/domain/LxjcjyDeploy.java
+51
-0
JczlcxMapper.java
...erface/src/main/java/me/zhengjie/mapper/JczlcxMapper.java
+14
-0
LxjcjyMapper.java
...erface/src/main/java/me/zhengjie/mapper/LxjcjyMapper.java
+14
-0
JczlcxDeployRepository.java
...n/java/me/zhengjie/repository/JczlcxDeployRepository.java
+29
-0
LxjcjyDeployRepository.java
...n/java/me/zhengjie/repository/LxjcjyDeployRepository.java
+29
-0
JczlcxService.java
...face/src/main/java/me/zhengjie/service/JczlcxService.java
+16
-0
LxjcjyService.java
...face/src/main/java/me/zhengjie/service/LxjcjyService.java
+16
-0
JczlcxDeployDto.java
...rc/main/java/me/zhengjie/service/dto/JczlcxDeployDto.java
+106
-0
JczlcxDeployQueryCriteria.java
...va/me/zhengjie/service/dto/JczlcxDeployQueryCriteria.java
+28
-0
LxjcjyDeployDto.java
...rc/main/java/me/zhengjie/service/dto/LxjcjyDeployDto.java
+35
-0
LxjcjyDeployQueryCriteria.java
...va/me/zhengjie/service/dto/LxjcjyDeployQueryCriteria.java
+27
-0
JczlcxServiceImpl.java
.../main/java/me/zhengjie/serviceimpl/JczlcxServiceImpl.java
+39
-0
LxjcjyServiceImpl.java
.../main/java/me/zhengjie/serviceimpl/LxjcjyServiceImpl.java
+34
-0
No files found.
eladmin-web/src/views/polling/jczlcx/Crud/CRUD.operation.vue
0 → 100644
View file @
7704443a
<
template
>
<div
class=
"crud-opts"
>
<el-button-group
class=
"crud-opts-right"
>
<el-button
size=
"mini"
plain
type=
"info"
icon=
"el-icon-search"
@
click=
"toggleSearch()"
/>
<el-button
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"crud.refresh()"
/>
<el-popover
placement=
"bottom-end"
width=
"150"
trigger=
"click"
>
<el-button
slot=
"reference"
size=
"mini"
icon=
"el-icon-s-grid"
>
<i
class=
"fa fa-caret-down"
aria-hidden=
"true"
/>
</el-button>
<el-checkbox
v-model=
"allColumnsSelected"
:indeterminate=
"allColumnsSelectedIndeterminate"
@
change=
"handleCheckAllChange"
>
全选
</el-checkbox>
<el-checkbox
v-for=
"item in tableColumns"
:key=
"item.property"
v-model=
"item.visible"
@
change=
"handleCheckedTableColumnsChange(item)"
>
{{
item
.
label
}}
</el-checkbox>
</el-popover>
</el-button-group>
</div>
</
template
>
<
script
>
import
CRUD
,
{
crud
}
from
'@crud/crud'
function
sortWithRef
(
src
,
ref
)
{
const
result
=
Object
.
assign
([],
ref
)
let
cursor
=
-
1
src
.
forEach
(
e
=>
{
const
idx
=
result
.
indexOf
(
e
)
if
(
idx
===
-
1
)
{
cursor
+=
1
result
.
splice
(
cursor
,
0
,
e
)
}
else
{
cursor
=
idx
}
})
return
result
}
export
default
{
mixins
:
[
crud
()],
props
:
{
permission
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
},
hiddenColumns
:
{
type
:
Array
,
default
:
()
=>
{
return
[]
}
},
ignoreColumns
:
{
type
:
Array
,
default
:
()
=>
{
return
[]
}
}
},
data
()
{
return
{
tableColumns
:
[],
allColumnsSelected
:
true
,
allColumnsSelectedIndeterminate
:
false
,
tableUnwatcher
:
null
,
// 忽略下次表格列变动
ignoreNextTableColumnsChange
:
false
}
},
watch
:
{
'crud.props.table'
()
{
this
.
updateTableColumns
()
this
.
tableColumns
.
forEach
(
column
=>
{
if
(
this
.
hiddenColumns
.
indexOf
(
column
.
property
)
!==
-
1
)
{
column
.
visible
=
false
this
.
updateColumnVisible
(
column
)
}
})
},
'crud.props.table.store.states.columns'
()
{
this
.
updateTableColumns
()
}
},
created
()
{
this
.
crud
.
updateProp
(
'searchToggle'
,
true
)
},
methods
:
{
updateTableColumns
()
{
const
table
=
this
.
crud
.
getTable
()
if
(
!
table
)
{
this
.
tableColumns
=
[]
return
}
let
cols
=
null
const
columnFilter
=
e
=>
e
&&
e
.
type
===
'default'
&&
e
.
property
&&
this
.
ignoreColumns
.
indexOf
(
e
.
property
)
===
-
1
const
refCols
=
table
.
columns
.
filter
(
columnFilter
)
if
(
this
.
ignoreNextTableColumnsChange
)
{
this
.
ignoreNextTableColumnsChange
=
false
return
}
this
.
ignoreNextTableColumnsChange
=
false
const
columns
=
[]
const
fullTableColumns
=
table
.
$children
.
map
(
e
=>
e
.
columnConfig
).
filter
(
columnFilter
)
cols
=
sortWithRef
(
fullTableColumns
,
refCols
)
cols
.
forEach
(
config
=>
{
const
column
=
{
property
:
config
.
property
,
label
:
config
.
label
,
visible
:
refCols
.
indexOf
(
config
)
!==
-
1
}
columns
.
push
(
column
)
})
this
.
tableColumns
=
columns
},
handleCheckAllChange
(
val
)
{
if
(
val
===
false
)
{
this
.
allColumnsSelected
=
true
return
}
this
.
tableColumns
.
forEach
(
column
=>
{
if
(
!
column
.
visible
)
{
column
.
visible
=
true
this
.
updateColumnVisible
(
column
)
}
})
this
.
allColumnsSelected
=
val
this
.
allColumnsSelectedIndeterminate
=
false
},
handleCheckedTableColumnsChange
(
item
)
{
let
totalCount
=
0
let
selectedCount
=
0
this
.
tableColumns
.
forEach
(
column
=>
{
++
totalCount
selectedCount
+=
column
.
visible
?
1
:
0
})
if
(
selectedCount
===
0
)
{
this
.
crud
.
notify
(
'请至少选择一列'
,
CRUD
.
NOTIFICATION_TYPE
.
WARNING
)
this
.
$nextTick
(
function
()
{
item
.
visible
=
true
})
return
}
this
.
allColumnsSelected
=
selectedCount
===
totalCount
this
.
allColumnsSelectedIndeterminate
=
selectedCount
!==
totalCount
&&
selectedCount
!==
0
this
.
updateColumnVisible
(
item
)
},
updateColumnVisible
(
item
)
{
const
table
=
this
.
crud
.
props
.
table
const
vm
=
table
.
$children
.
find
(
e
=>
e
.
prop
===
item
.
property
)
const
columnConfig
=
vm
.
columnConfig
if
(
item
.
visible
)
{
// 找出合适的插入点
const
columnIndex
=
this
.
tableColumns
.
indexOf
(
item
)
vm
.
owner
.
store
.
commit
(
'insertColumn'
,
columnConfig
,
columnIndex
+
1
,
null
)
}
else
{
vm
.
owner
.
store
.
commit
(
'removeColumn'
,
columnConfig
,
null
)
}
this
.
ignoreNextTableColumnsChange
=
true
},
toggleSearch
()
{
this
.
crud
.
props
.
searchToggle
=
!
this
.
crud
.
props
.
searchToggle
}
}
}
</
script
>
<
style
>
.crud-opts
{
padding
:
4px
0
;
display
:
-webkit-flex
;
display
:
flex
;
align-items
:
center
;
}
.crud-opts
.crud-opts-right
{
margin-left
:
auto
;
}
.crud-opts
.crud-opts-right
span
{
float
:
left
;
}
</
style
>
eladmin-web/src/views/polling/jczlcx/Crud/Pagination.vue
0 → 100644
View file @
7704443a
<!--分页-->
<
template
>
<el-pagination
:page-size
.
sync=
"page.size"
:total=
"page.total"
:current-page
.
sync=
"page.page"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"crud.sizeChangeHandler($event)"
@
current-change=
"crud.pageChangeHandler"
/>
</
template
>
<
script
>
import
{
pagination
}
from
'@crud/crud'
export
default
{
mixins
:
[
pagination
()]
}
</
script
>
eladmin-web/src/views/polling/jczlcx/Crud/RR.operation.vue
0 → 100644
View file @
7704443a
<!--搜索与重置-->
<
template
>
<span>
<el-button
class=
"filter-item"
size=
"mini"
type=
"success"
icon=
"el-icon-search"
@
click=
"crud.toQuery"
>
搜索
</el-button>
<el-button
v-if=
"crud.optShow.reset"
class=
"filter-item"
size=
"mini"
type=
"warning"
icon=
"el-icon-refresh-left"
@
click=
"crud.resetQuery()"
>
重置
</el-button>
</span>
</
template
>
<
script
>
import
{
crud
}
from
'@crud/crud'
export
default
{
mixins
:
[
crud
()],
props
:
{
itemClass
:
{
type
:
String
,
required
:
false
,
default
:
''
}
}
}
</
script
>
eladmin-web/src/views/polling/jczlcx/Crud/UD.operation.vue
0 → 100644
View file @
7704443a
<
template
>
<div>
<el-button
v-permission=
"permission.edit"
:loading=
"crud.status.cu === 2"
:disabled=
"disabledEdit"
size=
"mini"
type=
"primary"
icon=
"el-icon-chat-line-square"
@
click=
"crud.toEdit(data)"
>
查看详情
</el-button>
<el-popover
v-model=
"pop"
v-permission=
"permission.del"
placement=
"top"
width=
"180"
trigger=
"manual"
@
show=
"onPopoverShow"
@
hide=
"onPopoverHide"
>
<p>
{{
msg
}}
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"doCancel"
>
取消
</el-button>
<el-button
:loading=
"crud.dataStatus[crud.getDataId(data)].delete === 2"
type=
"primary"
size=
"mini"
@
click=
"crud.doDelete(data)"
>
确定
</el-button>
</div>
<!-- 删除按钮,此页面只需要查询,所以注释-->
<!--
<el-button
slot=
"reference"
:disabled=
"disabledDle"
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
@
click=
"toDelete"
/>
-->
</el-popover>
</div>
</
template
>
<
script
>
import
CRUD
,
{
crud
}
from
'@crud/crud'
export
default
{
mixins
:
[
crud
()],
props
:
{
data
:
{
type
:
Object
,
required
:
true
},
permission
:
{
type
:
Object
,
required
:
true
},
disabledEdit
:
{
type
:
Boolean
,
default
:
false
},
disabledDle
:
{
type
:
Boolean
,
default
:
false
},
msg
:
{
type
:
String
,
default
:
'确定删除本条数据吗?'
}
},
data
()
{
return
{
pop
:
false
}
},
methods
:
{
doCancel
()
{
this
.
pop
=
false
this
.
crud
.
cancelDelete
(
this
.
data
)
},
toDelete
()
{
this
.
pop
=
true
},
[
CRUD
.
HOOK
.
afterDelete
](
crud
,
data
)
{
if
(
data
===
this
.
data
)
{
this
.
pop
=
false
}
},
onPopoverShow
()
{
setTimeout
(()
=>
{
document
.
addEventListener
(
'click'
,
this
.
handleDocumentClick
)
},
0
)
},
onPopoverHide
()
{
document
.
removeEventListener
(
'click'
,
this
.
handleDocumentClick
)
},
handleDocumentClick
(
event
)
{
this
.
pop
=
false
}
}
}
</
script
>
eladmin-web/src/views/polling/jczlcx/Crud/crud.js
0 → 100644
View file @
7704443a
import
{
initData
,
download
}
from
'@/api/data'
import
{
parseTime
,
downloadFile
}
from
'@/utils/index'
import
Vue
from
'vue'
/**
* CRUD配置
* @author moxun
* @param {*} options <br>
* @return crud instance.
* @example
* 要使用多crud时,请在关联crud的组件处使用crud-tag进行标记,如:<jobForm :job-status="dict.job_status" crud-tag="job" />
*/
function
CRUD
(
options
)
{
const
defaultOptions
=
{
tag
:
'default'
,
// id字段名
idField
:
'id'
,
// 标题
title
:
''
,
// 请求数据的url
url
:
''
,
// 表格数据
data
:
[],
// 选择项
selections
:
[],
// 待查询的对象
query
:
{},
// 查询数据的参数
params
:
{},
// Form 表单
form
:
{},
// 重置表单
defaultForm
:
()
=>
{},
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
sort
:
[
'id,desc'
],
// 等待时间
time
:
50
,
// CRUD Method
crudMethod
:
{
add
:
(
form
)
=>
{},
del
:
(
id
)
=>
{},
edit
:
(
form
)
=>
{},
get
:
(
id
)
=>
{}
},
// 主页操作栏显示哪些按钮
optShow
:
{
add
:
true
,
edit
:
true
,
del
:
true
,
download
:
true
,
reset
:
true
},
// 自定义一些扩展属性
props
:
{},
// 在主页准备
queryOnPresenterCreated
:
true
,
// 调试开关
debug
:
false
}
options
=
mergeOptions
(
defaultOptions
,
options
)
const
data
=
{
...
options
,
// 记录数据状态
dataStatus
:
{},
status
:
{
add
:
CRUD
.
STATUS
.
NORMAL
,
edit
:
CRUD
.
STATUS
.
NORMAL
,
// 添加或编辑状态
get
cu
()
{
if
(
this
.
add
===
CRUD
.
STATUS
.
NORMAL
&&
this
.
edit
===
CRUD
.
STATUS
.
NORMAL
)
{
return
CRUD
.
STATUS
.
NORMAL
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PREPARED
||
this
.
edit
===
CRUD
.
STATUS
.
PREPARED
)
{
return
CRUD
.
STATUS
.
PREPARED
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PROCESSING
||
this
.
edit
===
CRUD
.
STATUS
.
PROCESSING
)
{
return
CRUD
.
STATUS
.
PROCESSING
}
throw
new
Error
(
'wrong crud
\'
s cu status'
)
},
// 标题
get
title
()
{
return
this
.
add
>
CRUD
.
STATUS
.
NORMAL
?
`新增
${
crud
.
title
}
`
:
this
.
edit
>
CRUD
.
STATUS
.
NORMAL
?
`
${
crud
.
title
}
`
:
crud
.
title
}
},
msg
:
{
submit
:
'提交成功'
,
add
:
'新增成功'
,
edit
:
'编辑成功'
,
del
:
'删除成功'
},
page
:
{
// 页码
page
:
0
,
// 每页数据条数
size
:
10
,
// 总数据条数
total
:
0
},
// 整体loading
loading
:
false
,
// 导出的 Loading
downloadLoading
:
false
,
// 删除的 Loading
delAllLoading
:
false
}
const
methods
=
{
/**
* 通用的提示
*/
submitSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
submit
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
addSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
add
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
editSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
edit
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
delSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
del
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
// 搜索
toQuery
()
{
crud
.
page
.
page
=
1
crud
.
refresh
()
},
// 刷新
refresh
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeRefresh
))
{
return
}
return
new
Promise
((
resolve
,
reject
)
=>
{
crud
.
loading
=
true
// 请求数据
initData
(
crud
.
url
,
crud
.
getQueryParams
()).
then
(
data
=>
{
const
table
=
crud
.
getTable
()
if
(
table
&&
table
.
lazy
)
{
// 懒加载子节点数据,清掉已加载的数据
table
.
store
.
states
.
treeData
=
{}
table
.
store
.
states
.
lazyTreeNodeMap
=
{}
}
crud
.
page
.
total
=
data
.
totalElements
crud
.
data
=
data
.
content
crud
.
resetDataStatus
()
// time 毫秒后显示表格
setTimeout
(()
=>
{
crud
.
loading
=
false
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterRefresh
)
},
crud
.
time
)
resolve
(
data
)
}).
catch
(
err
=>
{
crud
.
loading
=
false
reject
(
err
)
})
})
},
/**
* 启动添加
*/
toAdd
()
{
crud
.
resetForm
()
if
(
!
(
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeToAdd
,
crud
.
form
)
&&
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeToCU
,
crud
.
form
)))
{
return
}
crud
.
status
.
add
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToAdd
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
},
/**
* 启动编辑
* @param {*} data 数据项
*/
toEdit
(
data
)
{
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
.
edit
=
CRUD
.
STATUS
.
PREPARED
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
edit
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToEdit
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
},
/**
* 启动删除
* @param {*} data 数据项
*/
toDelete
(
data
)
{
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
delete
=
CRUD
.
STATUS
.
PREPARED
},
/**
* 取消删除
* @param {*} data 数据项
*/
cancelDelete
(
data
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeDeleteCancel
,
data
))
{
return
}
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
delete
=
CRUD
.
STATUS
.
NORMAL
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterDeleteCancel
,
data
)
},
/**
* 取消新增/编辑
*/
cancelCU
()
{
const
addStatus
=
crud
.
status
.
add
const
editStatus
=
crud
.
status
.
edit
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeAddCancel
,
crud
.
form
))
{
return
}
crud
.
status
.
add
=
CRUD
.
STATUS
.
NORMAL
}
if
(
editStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeEditCancel
,
crud
.
form
))
{
return
}
crud
.
status
.
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
edit
=
CRUD
.
STATUS
.
NORMAL
}
crud
.
resetForm
()
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterAddCancel
,
crud
.
form
)
}
if
(
editStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditCancel
,
crud
.
form
)
}
// 清除表单验证
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
}
},
/**
* 提交新增/编辑
*/
submitCU
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeValidateCU
))
{
return
}
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
!
valid
)
{
return
}
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterValidateCU
))
{
return
}
if
(
crud
.
status
.
add
===
CRUD
.
STATUS
.
PREPARED
)
{
crud
.
doAdd
()
}
else
if
(
crud
.
status
.
edit
===
CRUD
.
STATUS
.
PREPARED
)
{
crud
.
doEdit
()
}
})
},
/**
* 执行添加
*/
doAdd
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeSubmit
))
{
return
}
crud
.
status
.
add
=
CRUD
.
STATUS
.
PROCESSING
crud
.
crudMethod
.
add
(
crud
.
form
).
then
(()
=>
{
crud
.
status
.
add
=
CRUD
.
STATUS
.
NORMAL
crud
.
resetForm
()
crud
.
addSuccessNotify
()
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterSubmit
)
crud
.
toQuery
()
}).
catch
(()
=>
{
crud
.
status
.
add
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterAddError
)
})
},
/**
* 执行编辑
*/
doEdit
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeSubmit
))
{
return
}
crud
.
status
.
edit
=
CRUD
.
STATUS
.
PROCESSING
crud
.
crudMethod
.
edit
(
crud
.
form
).
then
(()
=>
{
crud
.
status
.
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
editSuccessNotify
()
crud
.
resetForm
()
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterSubmit
)
crud
.
refresh
()
}).
catch
(()
=>
{
crud
.
status
.
edit
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditError
)
})
},
/**
* 执行删除
* @param {*} data 数据项
*/
doDelete
(
data
)
{
let
delAll
=
false
let
dataStatus
const
ids
=
[]
if
(
data
instanceof
Array
)
{
delAll
=
true
data
.
forEach
(
val
=>
{
ids
.
push
(
this
.
getDataId
(
val
))
})
}
else
{
ids
.
push
(
this
.
getDataId
(
data
))
dataStatus
=
crud
.
getDataStatus
(
this
.
getDataId
(
data
))
}
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeDelete
,
data
))
{
return
}
if
(
!
delAll
)
{
dataStatus
.
delete
=
CRUD
.
STATUS
.
PROCESSING
}
return
crud
.
crudMethod
.
del
(
ids
).
then
(()
=>
{
if
(
delAll
)
{
crud
.
delAllLoading
=
false
}
else
dataStatus
.
delete
=
CRUD
.
STATUS
.
PREPARED
crud
.
dleChangePage
(
1
)
crud
.
delSuccessNotify
()
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterDelete
,
data
)
crud
.
refresh
()
}).
catch
(()
=>
{
if
(
delAll
)
{
crud
.
delAllLoading
=
false
}
else
dataStatus
.
delete
=
CRUD
.
STATUS
.
PREPARED
})
},
/**
* 通用导出
*/
doExport
()
{
crud
.
downloadLoading
=
true
download
(
crud
.
url
+
'/download'
,
crud
.
getQueryParams
()).
then
(
result
=>
{
downloadFile
(
result
,
crud
.
title
+
'数据'
,
'xlsx'
)
crud
.
downloadLoading
=
false
}).
catch
(()
=>
{
crud
.
downloadLoading
=
false
})
},
/**
* 获取查询参数
*/
getQueryParams
:
function
()
{
// 清除参数无值的情况
Object
.
keys
(
crud
.
query
).
length
!==
0
&&
Object
.
keys
(
crud
.
query
).
forEach
(
item
=>
{
if
(
crud
.
query
[
item
]
===
null
||
crud
.
query
[
item
]
===
''
)
crud
.
query
[
item
]
=
undefined
})
Object
.
keys
(
crud
.
params
).
length
!==
0
&&
Object
.
keys
(
crud
.
params
).
forEach
(
item
=>
{
if
(
crud
.
params
[
item
]
===
null
||
crud
.
params
[
item
]
===
''
)
crud
.
params
[
item
]
=
undefined
})
return
{
page
:
crud
.
page
.
page
-
1
,
size
:
crud
.
page
.
size
,
sort
:
crud
.
sort
,
...
crud
.
query
,
...
crud
.
params
}
},
// 当前页改变
pageChangeHandler
(
e
)
{
crud
.
page
.
page
=
e
crud
.
refresh
()
},
// 每页条数改变
sizeChangeHandler
(
e
)
{
crud
.
page
.
size
=
e
crud
.
page
.
page
=
1
crud
.
refresh
()
},
// 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据
dleChangePage
(
size
)
{
if
(
crud
.
data
.
length
===
size
&&
crud
.
page
.
page
!==
1
)
{
crud
.
page
.
page
-=
1
}
},
// 选择改变
selectionChangeHandler
(
val
)
{
crud
.
selections
=
val
},
/**
* 重置查询参数
* @param {Boolean} toQuery 重置后进行查询操作
*/
resetQuery
(
toQuery
=
true
)
{
const
defaultQuery
=
JSON
.
parse
(
JSON
.
stringify
(
crud
.
defaultQuery
))
const
query
=
crud
.
query
Object
.
keys
(
query
).
forEach
(
key
=>
{
query
[
key
]
=
defaultQuery
[
key
]
})
// 重置参数
this
.
params
=
{}
if
(
toQuery
)
{
crud
.
toQuery
()
}
},
/**
* 重置表单
* @param {Array} data 数据
*/
resetForm
(
data
)
{
const
form
=
data
||
(
typeof
crud
.
defaultForm
===
'object'
?
JSON
.
parse
(
JSON
.
stringify
(
crud
.
defaultForm
))
:
crud
.
defaultForm
.
apply
(
crud
.
findVM
(
'form'
)))
const
crudFrom
=
crud
.
form
for
(
const
key
in
form
)
{
if
(
crudFrom
.
hasOwnProperty
(
key
))
{
crudFrom
[
key
]
=
form
[
key
]
}
else
{
Vue
.
set
(
crudFrom
,
key
,
form
[
key
])
}
}
// add by ghl 2020-10-04 页面重复添加信息时,下拉框的校验会存在,需要找工取消
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
}
},
/**
* 重置数据状态
*/
resetDataStatus
()
{
const
dataStatus
=
{}
function
resetStatus
(
datas
)
{
datas
.
forEach
(
e
=>
{
dataStatus
[
crud
.
getDataId
(
e
)]
=
{
delete
:
0
,
edit
:
0
}
if
(
e
.
children
)
{
resetStatus
(
e
.
children
)
}
})
}
resetStatus
(
crud
.
data
)
crud
.
dataStatus
=
dataStatus
},
/**
* 获取数据状态
* @param {Number | String} id 数据项id
*/
getDataStatus
(
id
)
{
return
crud
.
dataStatus
[
id
]
},
/**
* 用于树形表格多选, 选中所有
* @param selection
*/
selectAllChange
(
selection
)
{
// 如果选中的数目与请求到的数目相同就选中子节点,否则就清空选中
if
(
selection
&&
selection
.
length
===
crud
.
data
.
length
)
{
selection
.
forEach
(
val
=>
{
crud
.
selectChange
(
selection
,
val
)
})
}
else
{
crud
.
getTable
().
clearSelection
()
}
},
/**
* 用于树形表格多选,单选的封装
* @param selection
* @param row
*/
selectChange
(
selection
,
row
)
{
// 如果selection中存在row代表是选中,否则是取消选中
if
(
selection
.
find
(
val
=>
{
return
crud
.
getDataId
(
val
)
===
crud
.
getDataId
(
row
)
}))
{
if
(
row
.
children
)
{
row
.
children
.
forEach
(
val
=>
{
crud
.
getTable
().
toggleRowSelection
(
val
,
true
)
selection
.
push
(
val
)
if
(
val
.
children
)
{
crud
.
selectChange
(
selection
,
val
)
}
})
}
}
else
{
crud
.
toggleRowSelection
(
selection
,
row
)
}
},
/**
* 切换选中状态
* @param selection
* @param data
*/
toggleRowSelection
(
selection
,
data
)
{
if
(
data
.
children
)
{
data
.
children
.
forEach
(
val
=>
{
crud
.
getTable
().
toggleRowSelection
(
val
,
false
)
if
(
val
.
children
)
{
crud
.
toggleRowSelection
(
selection
,
val
)
}
})
}
},
findVM
(
type
)
{
return
crud
.
vms
.
find
(
vm
=>
vm
&&
vm
.
type
===
type
).
vm
},
notify
(
title
,
type
=
CRUD
.
NOTIFICATION_TYPE
.
INFO
)
{
crud
.
vms
[
0
].
vm
.
$notify
({
title
,
type
,
duration
:
2500
})
},
updateProp
(
name
,
value
)
{
Vue
.
set
(
crud
.
props
,
name
,
value
)
},
getDataId
(
data
)
{
return
data
[
this
.
idField
]
},
getTable
()
{
return
this
.
findVM
(
'presenter'
).
$refs
.
table
},
attchTable
()
{
const
table
=
this
.
getTable
()
this
.
updateProp
(
'table'
,
table
)
const
that
=
this
table
.
$on
(
'expand-change'
,
(
row
,
expanded
)
=>
{
if
(
!
expanded
)
{
return
}
const
lazyTreeNodeMap
=
table
.
store
.
states
.
lazyTreeNodeMap
row
.
children
=
lazyTreeNodeMap
[
crud
.
getDataId
(
row
)]
if
(
row
.
children
)
{
row
.
children
.
forEach
(
ele
=>
{
const
id
=
crud
.
getDataId
(
ele
)
if
(
that
.
dataStatus
[
id
]
===
undefined
)
{
that
.
dataStatus
[
id
]
=
{
delete
:
0
,
edit
:
0
}
}
})
}
})
}
}
const
crud
=
Object
.
assign
({},
data
)
// 可观测化
Vue
.
observable
(
crud
)
// 附加方法
Object
.
assign
(
crud
,
methods
)
// 记录初始默认的查询参数,后续重置查询时使用
Object
.
assign
(
crud
,
{
defaultQuery
:
JSON
.
parse
(
JSON
.
stringify
(
data
.
query
)),
// 预留4位存储:组件 主页、头部、分页、表单,调试查看也方便找
vms
:
Array
(
4
),
/**
* 注册组件实例
* @param {String} type 类型
* @param {*} vm 组件实例
* @param {Number} index 该参数内部使用
*/
registerVM
(
type
,
vm
,
index
=
-
1
)
{
const
vmObj
=
{
type
,
vm
:
vm
}
if
(
index
<
0
)
{
this
.
vms
.
push
(
vmObj
)
return
}
if
(
index
<
4
)
{
// 内置预留vm数
this
.
vms
[
index
]
=
vmObj
return
}
this
.
vms
.
length
=
Math
.
max
(
this
.
vms
.
length
,
index
)
this
.
vms
.
splice
(
index
,
1
,
vmObj
)
},
/**
* 取消注册组件实例
* @param {*} vm 组件实例
*/
unregisterVM
(
type
,
vm
)
{
for
(
let
i
=
this
.
vms
.
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
this
.
vms
[
i
]
===
undefined
)
{
continue
}
if
(
this
.
vms
[
i
].
type
===
type
&&
this
.
vms
[
i
].
vm
===
vm
)
{
if
(
i
<
4
)
{
// 内置预留vm数
this
.
vms
[
i
]
=
undefined
}
else
{
this
.
vms
.
splice
(
i
,
1
)
}
break
}
}
}
})
// 冻结处理,需要扩展数据的话,使用crud.updateProp(name, value),以crud.props.name形式访问,这个是响应式的,可以做数据绑定
Object
.
freeze
(
crud
)
return
crud
}
// hook VM
function
callVmHook
(
crud
,
hook
)
{
if
(
crud
.
debug
)
{
console
.
log
(
'callVmHook: '
+
hook
)
}
const
tagHook
=
crud
.
tag
?
hook
+
'$'
+
crud
.
tag
:
null
let
ret
=
true
const
nargs
=
[
crud
]
for
(
let
i
=
2
;
i
<
arguments
.
length
;
++
i
)
{
nargs
.
push
(
arguments
[
i
])
}
// 有些组件扮演了多个角色,调用钩子时,需要去重
const
vmSet
=
new
Set
()
crud
.
vms
.
forEach
(
vm
=>
vm
&&
vmSet
.
add
(
vm
.
vm
))
vmSet
.
forEach
(
vm
=>
{
if
(
vm
[
hook
])
{
ret
=
vm
[
hook
].
apply
(
vm
,
nargs
)
!==
false
&&
ret
}
if
(
tagHook
&&
vm
[
tagHook
])
{
ret
=
vm
[
tagHook
].
apply
(
vm
,
nargs
)
!==
false
&&
ret
}
})
return
ret
}
function
mergeOptions
(
src
,
opts
)
{
const
optsRet
=
{
...
src
}
for
(
const
key
in
src
)
{
if
(
opts
.
hasOwnProperty
(
key
))
{
optsRet
[
key
]
=
opts
[
key
]
}
}
return
optsRet
}
/**
* 查找crud
* @param {*} vm
* @param {string} tag
*/
function
lookupCrud
(
vm
,
tag
)
{
tag
=
tag
||
vm
.
$attrs
[
'crud-tag'
]
||
'default'
// function lookupCrud(vm, tag) {
if
(
vm
.
$crud
)
{
const
ret
=
vm
.
$crud
[
tag
]
if
(
ret
)
{
return
ret
}
}
return
vm
.
$parent
?
lookupCrud
(
vm
.
$parent
,
tag
)
:
undefined
}
/**
* crud主页
*/
function
presenter
(
crud
)
{
if
(
crud
)
{
console
.
warn
(
'[CRUD warn]: '
+
'please use $options.cruds() { return CRUD(...) or [CRUD(...), ...] }'
)
}
return
{
data
()
{
// 在data中返回crud,是为了将crud与当前实例关联,组件观测crud相关属性变化
return
{
crud
:
this
.
crud
}
},
beforeCreate
()
{
this
.
$crud
=
this
.
$crud
||
{}
let
cruds
=
this
.
$options
.
cruds
instanceof
Function
?
this
.
$options
.
cruds
()
:
crud
if
(
!
(
cruds
instanceof
Array
))
{
cruds
=
[
cruds
]
}
cruds
.
forEach
(
ele
=>
{
if
(
this
.
$crud
[
ele
.
tag
])
{
console
.
error
(
'[CRUD error]: '
+
'crud with tag ['
+
ele
.
tag
+
' is already exist'
)
}
this
.
$crud
[
ele
.
tag
]
=
ele
ele
.
registerVM
(
'presenter'
,
this
,
0
)
})
this
.
crud
=
this
.
$crud
[
'defalut'
]
||
cruds
[
0
]
},
methods
:
{
parseTime
},
created
()
{
for
(
const
k
in
this
.
$crud
)
{
if
(
this
.
$crud
[
k
].
queryOnPresenterCreated
)
{
this
.
$crud
[
k
].
toQuery
()
}
}
},
destroyed
()
{
for
(
const
k
in
this
.
$crud
)
{
this
.
$crud
[
k
].
unregisterVM
(
'presenter'
,
this
)
}
},
mounted
()
{
// 如果table未实例化(例如使用了v-if),请稍后在适当时机crud.attchTable刷新table信息
if
(
this
.
$refs
.
table
!==
undefined
)
{
this
.
crud
.
attchTable
()
}
}
}
}
/**
* 头部
*/
function
header
()
{
return
{
data
()
{
return
{
crud
:
this
.
crud
,
query
:
this
.
crud
.
query
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
'header'
,
this
,
1
)
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
'header'
,
this
)
}
}
}
/**
* 分页
*/
function
pagination
()
{
return
{
data
()
{
return
{
crud
:
this
.
crud
,
page
:
this
.
crud
.
page
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
'pagination'
,
this
,
2
)
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
'pagination'
,
this
)
}
}
}
/**
* 表单
*/
function
form
(
defaultForm
)
{
return
{
data
()
{
return
{
crud
:
this
.
crud
,
form
:
this
.
crud
.
form
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
'form'
,
this
,
3
)
},
created
()
{
this
.
crud
.
defaultForm
=
defaultForm
this
.
crud
.
resetForm
()
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
'form'
,
this
)
}
}
}
/**
* crud
*/
function
crud
(
options
=
{})
{
const
defaultOptions
=
{
type
:
undefined
}
options
=
mergeOptions
(
defaultOptions
,
options
)
return
{
data
()
{
return
{
crud
:
this
.
crud
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
options
.
type
,
this
)
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
options
.
type
,
this
)
}
}
}
/**
* CRUD钩子
*/
CRUD
.
HOOK
=
{
/** 刷新 - 之前 */
beforeRefresh
:
'beforeCrudRefresh'
,
/** 刷新 - 之后 */
afterRefresh
:
'afterCrudRefresh'
,
/** 删除 - 之前 */
beforeDelete
:
'beforeCrudDelete'
,
/** 删除 - 之后 */
afterDelete
:
'afterCrudDelete'
,
/** 删除取消 - 之前 */
beforeDeleteCancel
:
'beforeCrudDeleteCancel'
,
/** 删除取消 - 之后 */
afterDeleteCancel
:
'afterCrudDeleteCancel'
,
/** 新建 - 之前 */
beforeToAdd
:
'beforeCrudToAdd'
,
/** 新建 - 之后 */
afterToAdd
:
'afterCrudToAdd'
,
/** 编辑 - 之前 */
beforeToEdit
:
'beforeCrudToEdit'
,
/** 编辑 - 之后 */
afterToEdit
:
'afterCrudToEdit'
,
/** 开始 "新建/编辑" - 之前 */
beforeToCU
:
'beforeCrudToCU'
,
/** 开始 "新建/编辑" - 之后 */
afterToCU
:
'afterCrudToCU'
,
/** "新建/编辑" 验证 - 之前 */
beforeValidateCU
:
'beforeCrudValidateCU'
,
/** "新建/编辑" 验证 - 之后 */
afterValidateCU
:
'afterCrudValidateCU'
,
/** 添加取消 - 之前 */
beforeAddCancel
:
'beforeCrudAddCancel'
,
/** 添加取消 - 之后 */
afterAddCancel
:
'afterCrudAddCancel'
,
/** 编辑取消 - 之前 */
beforeEditCancel
:
'beforeCrudEditCancel'
,
/** 编辑取消 - 之后 */
afterEditCancel
:
'afterCrudEditCancel'
,
/** 提交 - 之前 */
beforeSubmit
:
'beforeCrudSubmitCU'
,
/** 提交 - 之后 */
afterSubmit
:
'afterCrudSubmitCU'
,
afterAddError
:
'afterCrudAddError'
,
afterEditError
:
'afterCrudEditError'
}
/**
* CRUD状态
*/
CRUD
.
STATUS
=
{
NORMAL
:
0
,
PREPARED
:
1
,
PROCESSING
:
2
}
/**
* CRUD通知类型
*/
CRUD
.
NOTIFICATION_TYPE
=
{
SUCCESS
:
'success'
,
WARNING
:
'warning'
,
INFO
:
'info'
,
ERROR
:
'error'
}
export
default
CRUD
export
{
presenter
,
header
,
form
,
pagination
,
crud
}
eladmin-web/src/views/polling/jczlcx/index.vue
0 → 100644
View file @
7704443a
<
template
>
<div
class=
"app-container"
>
<!--工具栏-->
<div
class=
"head-container"
>
<div
v-if=
"crud.props.searchToggle"
>
<!-- 搜索 -->
<el-input
v-model=
"query.qqjk"
clearable
placeholder=
"请求接口名称"
style=
"width: 200px"
class=
"filter-item"
@
keyup
.
enter
.
native=
"crud.toQuery"
/>
<date-range-picker
v-model=
"query.createTime"
class=
"date-item"
/>
<rrOperation
/>
</div>
<crudOperation
:permission=
"permission"
/>
</div>
<!--表单组件-->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"crud.cancelCU"
:visible
.
sync=
"crud.status.cu > 0"
:title=
"crud.status.title"
width=
"100%"
hight=
"100%"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"130px"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"请求接口"
prop=
"qqjk"
>
<el-input
v-model=
"form.qqjk"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"请求时间"
prop=
"qqsj"
>
<el-input
v-model=
"form.qqsj"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"请求内容"
prop=
"qqnr"
>
<el-input
v-model=
"form.qqnr"
type=
"textarea"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"响应时间"
prop=
"xysj"
>
<el-input
v-model
.
number=
"form.xysj"
style=
"width: 370px;"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"响应状态"
prop=
"xyzt"
>
<el-input
v-model
.
number=
"form.xyzt"
style=
"width: 370px;"
:disabled=
"true"
/>
</el-form-item>
<div
class=
"grid-content bg-purple-light"
/>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
/>
<el-form-item
label=
"响应内容"
prop=
"xynr"
>
<el-input
v-model=
"form.xynr"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-divider
content-position=
"left"
>
返回参数
</el-divider>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"单位名称"
prop=
"entName"
>
<el-input
v-model=
"form.entName"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"单位地址"
prop=
"xynr"
>
<el-input
v-model=
"form.dom"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"法人代表姓名"
prop=
"name"
>
<el-input
v-model=
"form.name"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"统一社会信用代码"
prop=
"uniscid"
>
<el-input
v-model=
"form.uniscid"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"成立日期"
prop=
"estDate"
>
<el-input
v-model=
"form.estDate"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"注册资本"
prop=
"name"
>
<el-input
v-model=
"form.regCap"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"经营(驻在)期限自"
prop=
"opFrom"
>
<el-input
v-model=
"form.opFrom"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"经营(驻在)期限至"
prop=
"opto"
>
<el-input
v-model=
"form.opto"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"登记机关"
prop=
"regOrgCn"
>
<el-input
v-model=
"form.regOrgCn"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"登记登记状态"
prop=
"regStateCn"
>
<el-input
v-model=
"form.regStateCn"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"企业经营范围"
prop=
"opScope"
>
<el-input
v-model=
"form.opScope"
type=
"textarea"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center"
>
<el-button
type=
"primary"
size=
"medium"
@
click=
"crud.cancelCU"
>
确认
</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref=
"table"
v-loading=
"crud.loading"
:data=
"crud.data"
style=
"width: 100%"
@
selection-change=
"crud.selectionChangeHandler"
>
<el-table-column
v-if=
"checkPer(['admin','serverDeploy:edit'])"
label=
"操作"
width=
"150px"
align=
"center"
>
<template
slot-scope=
"scope"
>
<udOperation
:data=
"scope.row"
:permission=
"permission"
/>
</
template
>
</el-table-column>
<!-- <el-table-column type="selection" width="55" />-->
<el-table-column
prop=
"qqjk"
label=
"请求接口"
/>
<el-table-column
prop=
"qqsj"
label=
"请求时间"
/>
<el-table-column
prop=
"xysj"
label=
"响应时间"
/>
<el-table-column
prop=
"xyzt"
label=
"响应状态"
/>
<el-table-column
prop=
"xynr"
label=
"响应内容"
/>
</el-table>
<!--分页组件-->
<pagination
/>
</div>
</template>
<
script
>
import
{
testServerConnect
}
from
'@/api/mnt/connect'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'./Crud/crud'
import
rrOperation
from
'./Crud/RR.operation'
import
udOperation
from
'./Crud/UD.operation'
import
pagination
from
'./Crud/Pagination'
import
DateRangePicker
from
'@/components/DateRangePicker'
import
crudOperation
from
'./Crud/CRUD.operation'
const
defaultForm
=
{
id
:
null
,
name
:
null
,
ip
:
null
,
port
:
22
,
account
:
'root'
,
password
:
null
}
export
default
{
name
:
'Jczlcx'
,
components
:
{
pagination
,
rrOperation
,
udOperation
,
DateRangePicker
,
crudOperation
},
cruds
()
{
return
CRUD
({
title
:
'缴存总览详情'
,
url
:
'api/JczlcxController'
,
crudMethod
:
{}})
},
mixins
:
[
presenter
(),
header
(),
form
(
defaultForm
),
crud
()],
data
()
{
return
{
// currView: 'index',
accountList
:
[],
accountMap
:
{},
loading
:
false
,
permission
:
{},
// 规则验证
rules
:
{
Demo
:
[
{
required
:
true
,
message
:
'请输入Demo'
,
trigger
:
'blur'
}
]
}
}
},
methods
:
{
testConnectServer
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
loading
=
true
testServerConnect
(
this
.
form
).
then
((
res
)
=>
{
this
.
loading
=
false
this
.
$notify
({
title
:
res
?
'连接成功'
:
'连接失败'
,
type
:
res
?
'success'
:
'error'
,
duration
:
2500
})
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
})
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
::v-deep
.el-input-number
.el-input__inner
{
text-align
:
left
;
}
</
style
>
eladmin-web/src/views/polling/lxjcjy/Crud/CRUD.operation.vue
0 → 100644
View file @
7704443a
<
template
>
<div
class=
"crud-opts"
>
<el-button-group
class=
"crud-opts-right"
>
<el-button
size=
"mini"
plain
type=
"info"
icon=
"el-icon-search"
@
click=
"toggleSearch()"
/>
<el-button
size=
"mini"
icon=
"el-icon-refresh"
@
click=
"crud.refresh()"
/>
<el-popover
placement=
"bottom-end"
width=
"150"
trigger=
"click"
>
<el-button
slot=
"reference"
size=
"mini"
icon=
"el-icon-s-grid"
>
<i
class=
"fa fa-caret-down"
aria-hidden=
"true"
/>
</el-button>
<el-checkbox
v-model=
"allColumnsSelected"
:indeterminate=
"allColumnsSelectedIndeterminate"
@
change=
"handleCheckAllChange"
>
全选
</el-checkbox>
<el-checkbox
v-for=
"item in tableColumns"
:key=
"item.property"
v-model=
"item.visible"
@
change=
"handleCheckedTableColumnsChange(item)"
>
{{
item
.
label
}}
</el-checkbox>
</el-popover>
</el-button-group>
</div>
</
template
>
<
script
>
import
CRUD
,
{
crud
}
from
'@crud/crud'
function
sortWithRef
(
src
,
ref
)
{
const
result
=
Object
.
assign
([],
ref
)
let
cursor
=
-
1
src
.
forEach
(
e
=>
{
const
idx
=
result
.
indexOf
(
e
)
if
(
idx
===
-
1
)
{
cursor
+=
1
result
.
splice
(
cursor
,
0
,
e
)
}
else
{
cursor
=
idx
}
})
return
result
}
export
default
{
mixins
:
[
crud
()],
props
:
{
permission
:
{
type
:
Object
,
default
:
()
=>
{
return
{}
}
},
hiddenColumns
:
{
type
:
Array
,
default
:
()
=>
{
return
[]
}
},
ignoreColumns
:
{
type
:
Array
,
default
:
()
=>
{
return
[]
}
}
},
data
()
{
return
{
tableColumns
:
[],
allColumnsSelected
:
true
,
allColumnsSelectedIndeterminate
:
false
,
tableUnwatcher
:
null
,
// 忽略下次表格列变动
ignoreNextTableColumnsChange
:
false
}
},
watch
:
{
'crud.props.table'
()
{
this
.
updateTableColumns
()
this
.
tableColumns
.
forEach
(
column
=>
{
if
(
this
.
hiddenColumns
.
indexOf
(
column
.
property
)
!==
-
1
)
{
column
.
visible
=
false
this
.
updateColumnVisible
(
column
)
}
})
},
'crud.props.table.store.states.columns'
()
{
this
.
updateTableColumns
()
}
},
created
()
{
this
.
crud
.
updateProp
(
'searchToggle'
,
true
)
},
methods
:
{
updateTableColumns
()
{
const
table
=
this
.
crud
.
getTable
()
if
(
!
table
)
{
this
.
tableColumns
=
[]
return
}
let
cols
=
null
const
columnFilter
=
e
=>
e
&&
e
.
type
===
'default'
&&
e
.
property
&&
this
.
ignoreColumns
.
indexOf
(
e
.
property
)
===
-
1
const
refCols
=
table
.
columns
.
filter
(
columnFilter
)
if
(
this
.
ignoreNextTableColumnsChange
)
{
this
.
ignoreNextTableColumnsChange
=
false
return
}
this
.
ignoreNextTableColumnsChange
=
false
const
columns
=
[]
const
fullTableColumns
=
table
.
$children
.
map
(
e
=>
e
.
columnConfig
).
filter
(
columnFilter
)
cols
=
sortWithRef
(
fullTableColumns
,
refCols
)
cols
.
forEach
(
config
=>
{
const
column
=
{
property
:
config
.
property
,
label
:
config
.
label
,
visible
:
refCols
.
indexOf
(
config
)
!==
-
1
}
columns
.
push
(
column
)
})
this
.
tableColumns
=
columns
},
handleCheckAllChange
(
val
)
{
if
(
val
===
false
)
{
this
.
allColumnsSelected
=
true
return
}
this
.
tableColumns
.
forEach
(
column
=>
{
if
(
!
column
.
visible
)
{
column
.
visible
=
true
this
.
updateColumnVisible
(
column
)
}
})
this
.
allColumnsSelected
=
val
this
.
allColumnsSelectedIndeterminate
=
false
},
handleCheckedTableColumnsChange
(
item
)
{
let
totalCount
=
0
let
selectedCount
=
0
this
.
tableColumns
.
forEach
(
column
=>
{
++
totalCount
selectedCount
+=
column
.
visible
?
1
:
0
})
if
(
selectedCount
===
0
)
{
this
.
crud
.
notify
(
'请至少选择一列'
,
CRUD
.
NOTIFICATION_TYPE
.
WARNING
)
this
.
$nextTick
(
function
()
{
item
.
visible
=
true
})
return
}
this
.
allColumnsSelected
=
selectedCount
===
totalCount
this
.
allColumnsSelectedIndeterminate
=
selectedCount
!==
totalCount
&&
selectedCount
!==
0
this
.
updateColumnVisible
(
item
)
},
updateColumnVisible
(
item
)
{
const
table
=
this
.
crud
.
props
.
table
const
vm
=
table
.
$children
.
find
(
e
=>
e
.
prop
===
item
.
property
)
const
columnConfig
=
vm
.
columnConfig
if
(
item
.
visible
)
{
// 找出合适的插入点
const
columnIndex
=
this
.
tableColumns
.
indexOf
(
item
)
vm
.
owner
.
store
.
commit
(
'insertColumn'
,
columnConfig
,
columnIndex
+
1
,
null
)
}
else
{
vm
.
owner
.
store
.
commit
(
'removeColumn'
,
columnConfig
,
null
)
}
this
.
ignoreNextTableColumnsChange
=
true
},
toggleSearch
()
{
this
.
crud
.
props
.
searchToggle
=
!
this
.
crud
.
props
.
searchToggle
}
}
}
</
script
>
<
style
>
.crud-opts
{
padding
:
4px
0
;
display
:
-webkit-flex
;
display
:
flex
;
align-items
:
center
;
}
.crud-opts
.crud-opts-right
{
margin-left
:
auto
;
}
.crud-opts
.crud-opts-right
span
{
float
:
left
;
}
</
style
>
eladmin-web/src/views/polling/lxjcjy/Crud/Pagination.vue
0 → 100644
View file @
7704443a
<!--分页-->
<
template
>
<el-pagination
:page-size
.
sync=
"page.size"
:total=
"page.total"
:current-page
.
sync=
"page.page"
style=
"margin-top: 8px;"
layout=
"total, prev, pager, next, sizes"
@
size-change=
"crud.sizeChangeHandler($event)"
@
current-change=
"crud.pageChangeHandler"
/>
</
template
>
<
script
>
import
{
pagination
}
from
'@crud/crud'
export
default
{
mixins
:
[
pagination
()]
}
</
script
>
eladmin-web/src/views/polling/lxjcjy/Crud/RR.operation.vue
0 → 100644
View file @
7704443a
<!--搜索与重置-->
<
template
>
<span>
<el-button
class=
"filter-item"
size=
"mini"
type=
"success"
icon=
"el-icon-search"
@
click=
"crud.toQuery"
>
搜索
</el-button>
<el-button
v-if=
"crud.optShow.reset"
class=
"filter-item"
size=
"mini"
type=
"warning"
icon=
"el-icon-refresh-left"
@
click=
"crud.resetQuery()"
>
重置
</el-button>
</span>
</
template
>
<
script
>
import
{
crud
}
from
'@crud/crud'
export
default
{
mixins
:
[
crud
()],
props
:
{
itemClass
:
{
type
:
String
,
required
:
false
,
default
:
''
}
}
}
</
script
>
eladmin-web/src/views/polling/lxjcjy/Crud/UD.operation.vue
0 → 100644
View file @
7704443a
<
template
>
<div>
<el-button
v-permission=
"permission.edit"
:loading=
"crud.status.cu === 2"
:disabled=
"disabledEdit"
size=
"mini"
type=
"primary"
icon=
"el-icon-chat-line-square"
@
click=
"crud.toEdit(data)"
>
查看详情
</el-button>
<el-popover
v-model=
"pop"
v-permission=
"permission.del"
placement=
"top"
width=
"180"
trigger=
"manual"
@
show=
"onPopoverShow"
@
hide=
"onPopoverHide"
>
<p>
{{
msg
}}
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"doCancel"
>
取消
</el-button>
<el-button
:loading=
"crud.dataStatus[crud.getDataId(data)].delete === 2"
type=
"primary"
size=
"mini"
@
click=
"crud.doDelete(data)"
>
确定
</el-button>
</div>
<!-- 删除按钮,此页面只需要查询,所以注释-->
<!--
<el-button
slot=
"reference"
:disabled=
"disabledDle"
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
@
click=
"toDelete"
/>
-->
</el-popover>
</div>
</
template
>
<
script
>
import
CRUD
,
{
crud
}
from
'@crud/crud'
export
default
{
mixins
:
[
crud
()],
props
:
{
data
:
{
type
:
Object
,
required
:
true
},
permission
:
{
type
:
Object
,
required
:
true
},
disabledEdit
:
{
type
:
Boolean
,
default
:
false
},
disabledDle
:
{
type
:
Boolean
,
default
:
false
},
msg
:
{
type
:
String
,
default
:
'确定删除本条数据吗?'
}
},
data
()
{
return
{
pop
:
false
}
},
methods
:
{
doCancel
()
{
this
.
pop
=
false
this
.
crud
.
cancelDelete
(
this
.
data
)
},
toDelete
()
{
this
.
pop
=
true
},
[
CRUD
.
HOOK
.
afterDelete
](
crud
,
data
)
{
if
(
data
===
this
.
data
)
{
this
.
pop
=
false
}
},
onPopoverShow
()
{
setTimeout
(()
=>
{
document
.
addEventListener
(
'click'
,
this
.
handleDocumentClick
)
},
0
)
},
onPopoverHide
()
{
document
.
removeEventListener
(
'click'
,
this
.
handleDocumentClick
)
},
handleDocumentClick
(
event
)
{
this
.
pop
=
false
}
}
}
</
script
>
eladmin-web/src/views/polling/lxjcjy/Crud/crud.js
0 → 100644
View file @
7704443a
import
{
initData
,
download
}
from
'@/api/data'
import
{
parseTime
,
downloadFile
}
from
'@/utils/index'
import
Vue
from
'vue'
/**
* CRUD配置
* @author moxun
* @param {*} options <br>
* @return crud instance.
* @example
* 要使用多crud时,请在关联crud的组件处使用crud-tag进行标记,如:<jobForm :job-status="dict.job_status" crud-tag="job" />
*/
function
CRUD
(
options
)
{
const
defaultOptions
=
{
tag
:
'default'
,
// id字段名
idField
:
'id'
,
// 标题
title
:
''
,
// 请求数据的url
url
:
''
,
// 表格数据
data
:
[],
// 选择项
selections
:
[],
// 待查询的对象
query
:
{},
// 查询数据的参数
params
:
{},
// Form 表单
form
:
{},
// 重置表单
defaultForm
:
()
=>
{},
// 排序规则,默认 id 降序, 支持多字段排序 ['id,desc', 'createTime,asc']
sort
:
[
'id,desc'
],
// 等待时间
time
:
50
,
// CRUD Method
crudMethod
:
{
add
:
(
form
)
=>
{},
del
:
(
id
)
=>
{},
edit
:
(
form
)
=>
{},
get
:
(
id
)
=>
{}
},
// 主页操作栏显示哪些按钮
optShow
:
{
add
:
true
,
edit
:
true
,
del
:
true
,
download
:
true
,
reset
:
true
},
// 自定义一些扩展属性
props
:
{},
// 在主页准备
queryOnPresenterCreated
:
true
,
// 调试开关
debug
:
false
}
options
=
mergeOptions
(
defaultOptions
,
options
)
const
data
=
{
...
options
,
// 记录数据状态
dataStatus
:
{},
status
:
{
add
:
CRUD
.
STATUS
.
NORMAL
,
edit
:
CRUD
.
STATUS
.
NORMAL
,
// 添加或编辑状态
get
cu
()
{
if
(
this
.
add
===
CRUD
.
STATUS
.
NORMAL
&&
this
.
edit
===
CRUD
.
STATUS
.
NORMAL
)
{
return
CRUD
.
STATUS
.
NORMAL
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PREPARED
||
this
.
edit
===
CRUD
.
STATUS
.
PREPARED
)
{
return
CRUD
.
STATUS
.
PREPARED
}
else
if
(
this
.
add
===
CRUD
.
STATUS
.
PROCESSING
||
this
.
edit
===
CRUD
.
STATUS
.
PROCESSING
)
{
return
CRUD
.
STATUS
.
PROCESSING
}
throw
new
Error
(
'wrong crud
\'
s cu status'
)
},
// 标题
get
title
()
{
return
this
.
add
>
CRUD
.
STATUS
.
NORMAL
?
`新增
${
crud
.
title
}
`
:
this
.
edit
>
CRUD
.
STATUS
.
NORMAL
?
`
${
crud
.
title
}
`
:
crud
.
title
}
},
msg
:
{
submit
:
'提交成功'
,
add
:
'新增成功'
,
edit
:
'编辑成功'
,
del
:
'删除成功'
},
page
:
{
// 页码
page
:
0
,
// 每页数据条数
size
:
10
,
// 总数据条数
total
:
0
},
// 整体loading
loading
:
false
,
// 导出的 Loading
downloadLoading
:
false
,
// 删除的 Loading
delAllLoading
:
false
}
const
methods
=
{
/**
* 通用的提示
*/
submitSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
submit
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
addSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
add
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
editSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
edit
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
delSuccessNotify
()
{
crud
.
notify
(
crud
.
msg
.
del
,
CRUD
.
NOTIFICATION_TYPE
.
SUCCESS
)
},
// 搜索
toQuery
()
{
crud
.
page
.
page
=
1
crud
.
refresh
()
},
// 刷新
refresh
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeRefresh
))
{
return
}
return
new
Promise
((
resolve
,
reject
)
=>
{
crud
.
loading
=
true
// 请求数据
initData
(
crud
.
url
,
crud
.
getQueryParams
()).
then
(
data
=>
{
const
table
=
crud
.
getTable
()
if
(
table
&&
table
.
lazy
)
{
// 懒加载子节点数据,清掉已加载的数据
table
.
store
.
states
.
treeData
=
{}
table
.
store
.
states
.
lazyTreeNodeMap
=
{}
}
crud
.
page
.
total
=
data
.
totalElements
crud
.
data
=
data
.
content
crud
.
resetDataStatus
()
// time 毫秒后显示表格
setTimeout
(()
=>
{
crud
.
loading
=
false
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterRefresh
)
},
crud
.
time
)
resolve
(
data
)
}).
catch
(
err
=>
{
crud
.
loading
=
false
reject
(
err
)
})
})
},
/**
* 启动添加
*/
toAdd
()
{
crud
.
resetForm
()
if
(
!
(
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeToAdd
,
crud
.
form
)
&&
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeToCU
,
crud
.
form
)))
{
return
}
crud
.
status
.
add
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToAdd
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
},
/**
* 启动编辑
* @param {*} data 数据项
*/
toEdit
(
data
)
{
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
.
edit
=
CRUD
.
STATUS
.
PREPARED
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
edit
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToEdit
,
crud
.
form
)
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterToCU
,
crud
.
form
)
},
/**
* 启动删除
* @param {*} data 数据项
*/
toDelete
(
data
)
{
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
delete
=
CRUD
.
STATUS
.
PREPARED
},
/**
* 取消删除
* @param {*} data 数据项
*/
cancelDelete
(
data
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeDeleteCancel
,
data
))
{
return
}
crud
.
getDataStatus
(
crud
.
getDataId
(
data
)).
delete
=
CRUD
.
STATUS
.
NORMAL
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterDeleteCancel
,
data
)
},
/**
* 取消新增/编辑
*/
cancelCU
()
{
const
addStatus
=
crud
.
status
.
add
const
editStatus
=
crud
.
status
.
edit
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeAddCancel
,
crud
.
form
))
{
return
}
crud
.
status
.
add
=
CRUD
.
STATUS
.
NORMAL
}
if
(
editStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeEditCancel
,
crud
.
form
))
{
return
}
crud
.
status
.
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
edit
=
CRUD
.
STATUS
.
NORMAL
}
crud
.
resetForm
()
if
(
addStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterAddCancel
,
crud
.
form
)
}
if
(
editStatus
===
CRUD
.
STATUS
.
PREPARED
)
{
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditCancel
,
crud
.
form
)
}
// 清除表单验证
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
}
},
/**
* 提交新增/编辑
*/
submitCU
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeValidateCU
))
{
return
}
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
validate
(
valid
=>
{
if
(
!
valid
)
{
return
}
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterValidateCU
))
{
return
}
if
(
crud
.
status
.
add
===
CRUD
.
STATUS
.
PREPARED
)
{
crud
.
doAdd
()
}
else
if
(
crud
.
status
.
edit
===
CRUD
.
STATUS
.
PREPARED
)
{
crud
.
doEdit
()
}
})
},
/**
* 执行添加
*/
doAdd
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeSubmit
))
{
return
}
crud
.
status
.
add
=
CRUD
.
STATUS
.
PROCESSING
crud
.
crudMethod
.
add
(
crud
.
form
).
then
(()
=>
{
crud
.
status
.
add
=
CRUD
.
STATUS
.
NORMAL
crud
.
resetForm
()
crud
.
addSuccessNotify
()
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterSubmit
)
crud
.
toQuery
()
}).
catch
(()
=>
{
crud
.
status
.
add
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterAddError
)
})
},
/**
* 执行编辑
*/
doEdit
()
{
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeSubmit
))
{
return
}
crud
.
status
.
edit
=
CRUD
.
STATUS
.
PROCESSING
crud
.
crudMethod
.
edit
(
crud
.
form
).
then
(()
=>
{
crud
.
status
.
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
getDataStatus
(
crud
.
getDataId
(
crud
.
form
)).
edit
=
CRUD
.
STATUS
.
NORMAL
crud
.
editSuccessNotify
()
crud
.
resetForm
()
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterSubmit
)
crud
.
refresh
()
}).
catch
(()
=>
{
crud
.
status
.
edit
=
CRUD
.
STATUS
.
PREPARED
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterEditError
)
})
},
/**
* 执行删除
* @param {*} data 数据项
*/
doDelete
(
data
)
{
let
delAll
=
false
let
dataStatus
const
ids
=
[]
if
(
data
instanceof
Array
)
{
delAll
=
true
data
.
forEach
(
val
=>
{
ids
.
push
(
this
.
getDataId
(
val
))
})
}
else
{
ids
.
push
(
this
.
getDataId
(
data
))
dataStatus
=
crud
.
getDataStatus
(
this
.
getDataId
(
data
))
}
if
(
!
callVmHook
(
crud
,
CRUD
.
HOOK
.
beforeDelete
,
data
))
{
return
}
if
(
!
delAll
)
{
dataStatus
.
delete
=
CRUD
.
STATUS
.
PROCESSING
}
return
crud
.
crudMethod
.
del
(
ids
).
then
(()
=>
{
if
(
delAll
)
{
crud
.
delAllLoading
=
false
}
else
dataStatus
.
delete
=
CRUD
.
STATUS
.
PREPARED
crud
.
dleChangePage
(
1
)
crud
.
delSuccessNotify
()
callVmHook
(
crud
,
CRUD
.
HOOK
.
afterDelete
,
data
)
crud
.
refresh
()
}).
catch
(()
=>
{
if
(
delAll
)
{
crud
.
delAllLoading
=
false
}
else
dataStatus
.
delete
=
CRUD
.
STATUS
.
PREPARED
})
},
/**
* 通用导出
*/
doExport
()
{
crud
.
downloadLoading
=
true
download
(
crud
.
url
+
'/download'
,
crud
.
getQueryParams
()).
then
(
result
=>
{
downloadFile
(
result
,
crud
.
title
+
'数据'
,
'xlsx'
)
crud
.
downloadLoading
=
false
}).
catch
(()
=>
{
crud
.
downloadLoading
=
false
})
},
/**
* 获取查询参数
*/
getQueryParams
:
function
()
{
// 清除参数无值的情况
Object
.
keys
(
crud
.
query
).
length
!==
0
&&
Object
.
keys
(
crud
.
query
).
forEach
(
item
=>
{
if
(
crud
.
query
[
item
]
===
null
||
crud
.
query
[
item
]
===
''
)
crud
.
query
[
item
]
=
undefined
})
Object
.
keys
(
crud
.
params
).
length
!==
0
&&
Object
.
keys
(
crud
.
params
).
forEach
(
item
=>
{
if
(
crud
.
params
[
item
]
===
null
||
crud
.
params
[
item
]
===
''
)
crud
.
params
[
item
]
=
undefined
})
return
{
page
:
crud
.
page
.
page
-
1
,
size
:
crud
.
page
.
size
,
sort
:
crud
.
sort
,
...
crud
.
query
,
...
crud
.
params
}
},
// 当前页改变
pageChangeHandler
(
e
)
{
crud
.
page
.
page
=
e
crud
.
refresh
()
},
// 每页条数改变
sizeChangeHandler
(
e
)
{
crud
.
page
.
size
=
e
crud
.
page
.
page
=
1
crud
.
refresh
()
},
// 预防删除第二页最后一条数据时,或者多选删除第二页的数据时,页码错误导致请求无数据
dleChangePage
(
size
)
{
if
(
crud
.
data
.
length
===
size
&&
crud
.
page
.
page
!==
1
)
{
crud
.
page
.
page
-=
1
}
},
// 选择改变
selectionChangeHandler
(
val
)
{
crud
.
selections
=
val
},
/**
* 重置查询参数
* @param {Boolean} toQuery 重置后进行查询操作
*/
resetQuery
(
toQuery
=
true
)
{
const
defaultQuery
=
JSON
.
parse
(
JSON
.
stringify
(
crud
.
defaultQuery
))
const
query
=
crud
.
query
Object
.
keys
(
query
).
forEach
(
key
=>
{
query
[
key
]
=
defaultQuery
[
key
]
})
// 重置参数
this
.
params
=
{}
if
(
toQuery
)
{
crud
.
toQuery
()
}
},
/**
* 重置表单
* @param {Array} data 数据
*/
resetForm
(
data
)
{
const
form
=
data
||
(
typeof
crud
.
defaultForm
===
'object'
?
JSON
.
parse
(
JSON
.
stringify
(
crud
.
defaultForm
))
:
crud
.
defaultForm
.
apply
(
crud
.
findVM
(
'form'
)))
const
crudFrom
=
crud
.
form
for
(
const
key
in
form
)
{
if
(
crudFrom
.
hasOwnProperty
(
key
))
{
crudFrom
[
key
]
=
form
[
key
]
}
else
{
Vue
.
set
(
crudFrom
,
key
,
form
[
key
])
}
}
// add by ghl 2020-10-04 页面重复添加信息时,下拉框的校验会存在,需要找工取消
if
(
crud
.
findVM
(
'form'
).
$refs
[
'form'
])
{
crud
.
findVM
(
'form'
).
$refs
[
'form'
].
clearValidate
()
}
},
/**
* 重置数据状态
*/
resetDataStatus
()
{
const
dataStatus
=
{}
function
resetStatus
(
datas
)
{
datas
.
forEach
(
e
=>
{
dataStatus
[
crud
.
getDataId
(
e
)]
=
{
delete
:
0
,
edit
:
0
}
if
(
e
.
children
)
{
resetStatus
(
e
.
children
)
}
})
}
resetStatus
(
crud
.
data
)
crud
.
dataStatus
=
dataStatus
},
/**
* 获取数据状态
* @param {Number | String} id 数据项id
*/
getDataStatus
(
id
)
{
return
crud
.
dataStatus
[
id
]
},
/**
* 用于树形表格多选, 选中所有
* @param selection
*/
selectAllChange
(
selection
)
{
// 如果选中的数目与请求到的数目相同就选中子节点,否则就清空选中
if
(
selection
&&
selection
.
length
===
crud
.
data
.
length
)
{
selection
.
forEach
(
val
=>
{
crud
.
selectChange
(
selection
,
val
)
})
}
else
{
crud
.
getTable
().
clearSelection
()
}
},
/**
* 用于树形表格多选,单选的封装
* @param selection
* @param row
*/
selectChange
(
selection
,
row
)
{
// 如果selection中存在row代表是选中,否则是取消选中
if
(
selection
.
find
(
val
=>
{
return
crud
.
getDataId
(
val
)
===
crud
.
getDataId
(
row
)
}))
{
if
(
row
.
children
)
{
row
.
children
.
forEach
(
val
=>
{
crud
.
getTable
().
toggleRowSelection
(
val
,
true
)
selection
.
push
(
val
)
if
(
val
.
children
)
{
crud
.
selectChange
(
selection
,
val
)
}
})
}
}
else
{
crud
.
toggleRowSelection
(
selection
,
row
)
}
},
/**
* 切换选中状态
* @param selection
* @param data
*/
toggleRowSelection
(
selection
,
data
)
{
if
(
data
.
children
)
{
data
.
children
.
forEach
(
val
=>
{
crud
.
getTable
().
toggleRowSelection
(
val
,
false
)
if
(
val
.
children
)
{
crud
.
toggleRowSelection
(
selection
,
val
)
}
})
}
},
findVM
(
type
)
{
return
crud
.
vms
.
find
(
vm
=>
vm
&&
vm
.
type
===
type
).
vm
},
notify
(
title
,
type
=
CRUD
.
NOTIFICATION_TYPE
.
INFO
)
{
crud
.
vms
[
0
].
vm
.
$notify
({
title
,
type
,
duration
:
2500
})
},
updateProp
(
name
,
value
)
{
Vue
.
set
(
crud
.
props
,
name
,
value
)
},
getDataId
(
data
)
{
return
data
[
this
.
idField
]
},
getTable
()
{
return
this
.
findVM
(
'presenter'
).
$refs
.
table
},
attchTable
()
{
const
table
=
this
.
getTable
()
this
.
updateProp
(
'table'
,
table
)
const
that
=
this
table
.
$on
(
'expand-change'
,
(
row
,
expanded
)
=>
{
if
(
!
expanded
)
{
return
}
const
lazyTreeNodeMap
=
table
.
store
.
states
.
lazyTreeNodeMap
row
.
children
=
lazyTreeNodeMap
[
crud
.
getDataId
(
row
)]
if
(
row
.
children
)
{
row
.
children
.
forEach
(
ele
=>
{
const
id
=
crud
.
getDataId
(
ele
)
if
(
that
.
dataStatus
[
id
]
===
undefined
)
{
that
.
dataStatus
[
id
]
=
{
delete
:
0
,
edit
:
0
}
}
})
}
})
}
}
const
crud
=
Object
.
assign
({},
data
)
// 可观测化
Vue
.
observable
(
crud
)
// 附加方法
Object
.
assign
(
crud
,
methods
)
// 记录初始默认的查询参数,后续重置查询时使用
Object
.
assign
(
crud
,
{
defaultQuery
:
JSON
.
parse
(
JSON
.
stringify
(
data
.
query
)),
// 预留4位存储:组件 主页、头部、分页、表单,调试查看也方便找
vms
:
Array
(
4
),
/**
* 注册组件实例
* @param {String} type 类型
* @param {*} vm 组件实例
* @param {Number} index 该参数内部使用
*/
registerVM
(
type
,
vm
,
index
=
-
1
)
{
const
vmObj
=
{
type
,
vm
:
vm
}
if
(
index
<
0
)
{
this
.
vms
.
push
(
vmObj
)
return
}
if
(
index
<
4
)
{
// 内置预留vm数
this
.
vms
[
index
]
=
vmObj
return
}
this
.
vms
.
length
=
Math
.
max
(
this
.
vms
.
length
,
index
)
this
.
vms
.
splice
(
index
,
1
,
vmObj
)
},
/**
* 取消注册组件实例
* @param {*} vm 组件实例
*/
unregisterVM
(
type
,
vm
)
{
for
(
let
i
=
this
.
vms
.
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
this
.
vms
[
i
]
===
undefined
)
{
continue
}
if
(
this
.
vms
[
i
].
type
===
type
&&
this
.
vms
[
i
].
vm
===
vm
)
{
if
(
i
<
4
)
{
// 内置预留vm数
this
.
vms
[
i
]
=
undefined
}
else
{
this
.
vms
.
splice
(
i
,
1
)
}
break
}
}
}
})
// 冻结处理,需要扩展数据的话,使用crud.updateProp(name, value),以crud.props.name形式访问,这个是响应式的,可以做数据绑定
Object
.
freeze
(
crud
)
return
crud
}
// hook VM
function
callVmHook
(
crud
,
hook
)
{
if
(
crud
.
debug
)
{
console
.
log
(
'callVmHook: '
+
hook
)
}
const
tagHook
=
crud
.
tag
?
hook
+
'$'
+
crud
.
tag
:
null
let
ret
=
true
const
nargs
=
[
crud
]
for
(
let
i
=
2
;
i
<
arguments
.
length
;
++
i
)
{
nargs
.
push
(
arguments
[
i
])
}
// 有些组件扮演了多个角色,调用钩子时,需要去重
const
vmSet
=
new
Set
()
crud
.
vms
.
forEach
(
vm
=>
vm
&&
vmSet
.
add
(
vm
.
vm
))
vmSet
.
forEach
(
vm
=>
{
if
(
vm
[
hook
])
{
ret
=
vm
[
hook
].
apply
(
vm
,
nargs
)
!==
false
&&
ret
}
if
(
tagHook
&&
vm
[
tagHook
])
{
ret
=
vm
[
tagHook
].
apply
(
vm
,
nargs
)
!==
false
&&
ret
}
})
return
ret
}
function
mergeOptions
(
src
,
opts
)
{
const
optsRet
=
{
...
src
}
for
(
const
key
in
src
)
{
if
(
opts
.
hasOwnProperty
(
key
))
{
optsRet
[
key
]
=
opts
[
key
]
}
}
return
optsRet
}
/**
* 查找crud
* @param {*} vm
* @param {string} tag
*/
function
lookupCrud
(
vm
,
tag
)
{
tag
=
tag
||
vm
.
$attrs
[
'crud-tag'
]
||
'default'
// function lookupCrud(vm, tag) {
if
(
vm
.
$crud
)
{
const
ret
=
vm
.
$crud
[
tag
]
if
(
ret
)
{
return
ret
}
}
return
vm
.
$parent
?
lookupCrud
(
vm
.
$parent
,
tag
)
:
undefined
}
/**
* crud主页
*/
function
presenter
(
crud
)
{
if
(
crud
)
{
console
.
warn
(
'[CRUD warn]: '
+
'please use $options.cruds() { return CRUD(...) or [CRUD(...), ...] }'
)
}
return
{
data
()
{
// 在data中返回crud,是为了将crud与当前实例关联,组件观测crud相关属性变化
return
{
crud
:
this
.
crud
}
},
beforeCreate
()
{
this
.
$crud
=
this
.
$crud
||
{}
let
cruds
=
this
.
$options
.
cruds
instanceof
Function
?
this
.
$options
.
cruds
()
:
crud
if
(
!
(
cruds
instanceof
Array
))
{
cruds
=
[
cruds
]
}
cruds
.
forEach
(
ele
=>
{
if
(
this
.
$crud
[
ele
.
tag
])
{
console
.
error
(
'[CRUD error]: '
+
'crud with tag ['
+
ele
.
tag
+
' is already exist'
)
}
this
.
$crud
[
ele
.
tag
]
=
ele
ele
.
registerVM
(
'presenter'
,
this
,
0
)
})
this
.
crud
=
this
.
$crud
[
'defalut'
]
||
cruds
[
0
]
},
methods
:
{
parseTime
},
created
()
{
for
(
const
k
in
this
.
$crud
)
{
if
(
this
.
$crud
[
k
].
queryOnPresenterCreated
)
{
this
.
$crud
[
k
].
toQuery
()
}
}
},
destroyed
()
{
for
(
const
k
in
this
.
$crud
)
{
this
.
$crud
[
k
].
unregisterVM
(
'presenter'
,
this
)
}
},
mounted
()
{
// 如果table未实例化(例如使用了v-if),请稍后在适当时机crud.attchTable刷新table信息
if
(
this
.
$refs
.
table
!==
undefined
)
{
this
.
crud
.
attchTable
()
}
}
}
}
/**
* 头部
*/
function
header
()
{
return
{
data
()
{
return
{
crud
:
this
.
crud
,
query
:
this
.
crud
.
query
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
'header'
,
this
,
1
)
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
'header'
,
this
)
}
}
}
/**
* 分页
*/
function
pagination
()
{
return
{
data
()
{
return
{
crud
:
this
.
crud
,
page
:
this
.
crud
.
page
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
'pagination'
,
this
,
2
)
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
'pagination'
,
this
)
}
}
}
/**
* 表单
*/
function
form
(
defaultForm
)
{
return
{
data
()
{
return
{
crud
:
this
.
crud
,
form
:
this
.
crud
.
form
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
'form'
,
this
,
3
)
},
created
()
{
this
.
crud
.
defaultForm
=
defaultForm
this
.
crud
.
resetForm
()
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
'form'
,
this
)
}
}
}
/**
* crud
*/
function
crud
(
options
=
{})
{
const
defaultOptions
=
{
type
:
undefined
}
options
=
mergeOptions
(
defaultOptions
,
options
)
return
{
data
()
{
return
{
crud
:
this
.
crud
}
},
beforeCreate
()
{
this
.
crud
=
lookupCrud
(
this
)
this
.
crud
.
registerVM
(
options
.
type
,
this
)
},
destroyed
()
{
this
.
crud
.
unregisterVM
(
options
.
type
,
this
)
}
}
}
/**
* CRUD钩子
*/
CRUD
.
HOOK
=
{
/** 刷新 - 之前 */
beforeRefresh
:
'beforeCrudRefresh'
,
/** 刷新 - 之后 */
afterRefresh
:
'afterCrudRefresh'
,
/** 删除 - 之前 */
beforeDelete
:
'beforeCrudDelete'
,
/** 删除 - 之后 */
afterDelete
:
'afterCrudDelete'
,
/** 删除取消 - 之前 */
beforeDeleteCancel
:
'beforeCrudDeleteCancel'
,
/** 删除取消 - 之后 */
afterDeleteCancel
:
'afterCrudDeleteCancel'
,
/** 新建 - 之前 */
beforeToAdd
:
'beforeCrudToAdd'
,
/** 新建 - 之后 */
afterToAdd
:
'afterCrudToAdd'
,
/** 编辑 - 之前 */
beforeToEdit
:
'beforeCrudToEdit'
,
/** 编辑 - 之后 */
afterToEdit
:
'afterCrudToEdit'
,
/** 开始 "新建/编辑" - 之前 */
beforeToCU
:
'beforeCrudToCU'
,
/** 开始 "新建/编辑" - 之后 */
afterToCU
:
'afterCrudToCU'
,
/** "新建/编辑" 验证 - 之前 */
beforeValidateCU
:
'beforeCrudValidateCU'
,
/** "新建/编辑" 验证 - 之后 */
afterValidateCU
:
'afterCrudValidateCU'
,
/** 添加取消 - 之前 */
beforeAddCancel
:
'beforeCrudAddCancel'
,
/** 添加取消 - 之后 */
afterAddCancel
:
'afterCrudAddCancel'
,
/** 编辑取消 - 之前 */
beforeEditCancel
:
'beforeCrudEditCancel'
,
/** 编辑取消 - 之后 */
afterEditCancel
:
'afterCrudEditCancel'
,
/** 提交 - 之前 */
beforeSubmit
:
'beforeCrudSubmitCU'
,
/** 提交 - 之后 */
afterSubmit
:
'afterCrudSubmitCU'
,
afterAddError
:
'afterCrudAddError'
,
afterEditError
:
'afterCrudEditError'
}
/**
* CRUD状态
*/
CRUD
.
STATUS
=
{
NORMAL
:
0
,
PREPARED
:
1
,
PROCESSING
:
2
}
/**
* CRUD通知类型
*/
CRUD
.
NOTIFICATION_TYPE
=
{
SUCCESS
:
'success'
,
WARNING
:
'warning'
,
INFO
:
'info'
,
ERROR
:
'error'
}
export
default
CRUD
export
{
presenter
,
header
,
form
,
pagination
,
crud
}
eladmin-web/src/views/polling/lxjcjy/index.vue
0 → 100644
View file @
7704443a
<
template
>
<div
class=
"app-container"
>
<!--工具栏-->
<div
class=
"head-container"
>
<div
v-if=
"crud.props.searchToggle"
>
<!-- 搜索 -->
<el-input
v-model=
"query.qqjk"
clearable
placeholder=
"请求接口名称"
style=
"width: 200px"
class=
"filter-item"
@
keyup
.
enter
.
native=
"crud.toQuery"
/>
<date-range-picker
v-model=
"query.createTime"
class=
"date-item"
/>
<rrOperation
/>
</div>
<crudOperation
:permission=
"permission"
/>
</div>
<!--表单组件-->
<el-dialog
append-to-body
:close-on-click-modal=
"false"
:before-close=
"crud.cancelCU"
:visible
.
sync=
"crud.status.cu > 0"
:title=
"crud.status.title"
width=
"100%"
hight=
"100%"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
size=
"small"
label-width=
"130px"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"请求接口"
prop=
"qqjk"
>
<el-input
v-model=
"form.qqjk"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"请求时间"
prop=
"qqsj"
>
<el-input
v-model=
"form.qqsj"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"请求内容"
prop=
"qqnr"
>
<el-input
v-model=
"form.qqnr"
type=
"textarea"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"响应时间"
prop=
"xysj"
>
<el-input
v-model
.
number=
"form.xysj"
style=
"width: 370px;"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"响应状态"
prop=
"xyzt"
>
<el-input
v-model
.
number=
"form.xyzt"
style=
"width: 370px;"
:disabled=
"true"
/>
</el-form-item>
<div
class=
"grid-content bg-purple-light"
/>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
/>
<el-form-item
label=
"响应内容"
prop=
"xynr"
>
<el-input
v-model=
"form.xynr"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</el-col>
</el-row>
<el-divider
content-position=
"left"
>
返回参数
</el-divider>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"单位名称"
prop=
"entName"
>
<el-input
v-model=
"form.entName"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"单位地址"
prop=
"xynr"
>
<el-input
v-model=
"form.dom"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"法人代表姓名"
prop=
"name"
>
<el-input
v-model=
"form.name"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"统一社会信用代码"
prop=
"uniscid"
>
<el-input
v-model=
"form.uniscid"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"成立日期"
prop=
"estDate"
>
<el-input
v-model=
"form.estDate"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"注册资本"
prop=
"name"
>
<el-input
v-model=
"form.regCap"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"经营(驻在)期限自"
prop=
"opFrom"
>
<el-input
v-model=
"form.opFrom"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"经营(驻在)期限至"
prop=
"opto"
>
<el-input
v-model=
"form.opto"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"登记机关"
prop=
"regOrgCn"
>
<el-input
v-model=
"form.regOrgCn"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"登记登记状态"
prop=
"regStateCn"
>
<el-input
v-model=
"form.regStateCn"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"企业经营范围"
prop=
"opScope"
>
<el-input
v-model=
"form.opScope"
type=
"textarea"
style=
"width: 370px"
:disabled=
"true"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center"
>
<el-button
type=
"primary"
size=
"medium"
@
click=
"crud.cancelCU"
>
确认
</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<el-table
ref=
"table"
v-loading=
"crud.loading"
:data=
"crud.data"
style=
"width: 100%"
@
selection-change=
"crud.selectionChangeHandler"
>
<el-table-column
v-if=
"checkPer(['admin','serverDeploy:edit'])"
label=
"操作"
width=
"150px"
align=
"center"
>
<template
slot-scope=
"scope"
>
<udOperation
:data=
"scope.row"
:permission=
"permission"
/>
</
template
>
</el-table-column>
<!-- <el-table-column type="selection" width="55" />-->
<el-table-column
prop=
"qqjk"
label=
"请求接口"
/>
<el-table-column
prop=
"qqsj"
label=
"请求时间"
/>
<el-table-column
prop=
"xysj"
label=
"响应时间"
/>
<el-table-column
prop=
"xyzt"
label=
"响应状态"
/>
<el-table-column
prop=
"xynr"
label=
"响应内容"
/>
</el-table>
<!--分页组件-->
<pagination
/>
</div>
</template>
<
script
>
import
{
testServerConnect
}
from
'@/api/mnt/connect'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'./Crud/crud'
import
rrOperation
from
'./Crud/RR.operation'
import
udOperation
from
'./Crud/UD.operation'
import
pagination
from
'./Crud/Pagination'
import
DateRangePicker
from
'@/components/DateRangePicker'
import
crudOperation
from
'./Crud/CRUD.operation'
const
defaultForm
=
{
id
:
null
,
name
:
null
,
ip
:
null
,
port
:
22
,
account
:
'root'
,
password
:
null
}
export
default
{
name
:
'Lxjcjy'
,
components
:
{
pagination
,
rrOperation
,
udOperation
,
DateRangePicker
,
crudOperation
},
cruds
()
{
return
CRUD
({
title
:
'连续缴存校验'
,
url
:
'api/LxjcjyController'
,
crudMethod
:
{}})
},
mixins
:
[
presenter
(),
header
(),
form
(
defaultForm
),
crud
()],
data
()
{
return
{
// currView: 'index',
accountList
:
[],
accountMap
:
{},
loading
:
false
,
permission
:
{},
// 规则验证
rules
:
{
Demo
:
[
{
required
:
true
,
message
:
'请输入Demo'
,
trigger
:
'blur'
}
]
}
}
},
methods
:
{
testConnectServer
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
this
.
loading
=
true
testServerConnect
(
this
.
form
).
then
((
res
)
=>
{
this
.
loading
=
false
this
.
$notify
({
title
:
res
?
'连接成功'
:
'连接失败'
,
type
:
res
?
'success'
:
'error'
,
duration
:
2500
})
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
})
}
}
}
</
script
>
<
style
rel=
"stylesheet/scss"
lang=
"scss"
scoped
>
::v-deep
.el-input-number
.el-input__inner
{
text-align
:
left
;
}
</
style
>
eladmin/eladmin-interface/src/main/java/me/zhengjie/controller/JczlcxController.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.service.JczlcxService
;
import
me.zhengjie.service.QyxxcxService
;
import
me.zhengjie.service.dto.JczlcxDeployQueryCriteria
;
import
me.zhengjie.service.dto.QyxxcxDeployQueryCriteria
;
import
me.zhengjie.util.shengneiUtil
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
//import static me.zhengjie.util.shengneiUtil.createSSLClientDefault;
//import static me.zhengjie.util.shengneiUtil.doPost;
/**
* @author Zheng Jie
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"api/JczlcxController"
)
@Api
(
tags
=
"查询:缴存总览查询接口流水"
)
public
class
JczlcxController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
JczlcxController
.
class
);
@Autowired
private
JczlcxService
jczlcxService
;
@ApiOperation
(
"查询公司注册信息"
)
@AnonymousAccess
@RequestMapping
(
"/Test"
)
public
Map
Test
(){
CloseableHttpClient
httpClinet
=
shengneiUtil
.
createSSLClientDefault
();
/*String token = getToken(httpClinet);
System.out.println(token);
JSONObject parseObject = JSON.parseObject(token);*/
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
da
=
sdf
.
format
(
date
);
String
url
=
"https://gateway.zsj.jl.cegn.cn/api/visual/queryEBaseinfos"
;
JSONObject
obj
=
new
JSONObject
();
String
doPost
=
shengneiUtil
.
doPost
(
url
,
obj
.
toString
(),
"514f30bb290b875cf718ef0f10886c15"
,
httpClinet
);
logger
.
info
(
doPost
);
return
new
HashMap
<>();
}
@ApiOperation
(
value
=
"查询企业信息接口流水"
)
@GetMapping
@PreAuthorize
(
"@el.check('serverDeploy:list')"
)
public
ResponseEntity
<
Object
>
query
(
JczlcxDeployQueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
<>(
jczlcxService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/controller/LxjcjyController.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.service.JczlcxService
;
import
me.zhengjie.service.LxjcjyService
;
import
me.zhengjie.service.dto.JczlcxDeployQueryCriteria
;
import
me.zhengjie.service.dto.LxjcjyDeployQueryCriteria
;
import
me.zhengjie.util.shengneiUtil
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
//import static me.zhengjie.util.shengneiUtil.createSSLClientDefault;
//import static me.zhengjie.util.shengneiUtil.doPost;
/**
* @author Zheng Jie
*/
@RestController
@RequiredArgsConstructor
@RequestMapping
(
"api/LxjcjyController"
)
@Api
(
tags
=
"查询:连续缴存校验接口流水"
)
public
class
LxjcjyController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
LxjcjyController
.
class
);
@Autowired
private
LxjcjyService
lxjcjyService
;
@ApiOperation
(
"查询公司注册信息"
)
@AnonymousAccess
@RequestMapping
(
"/Test"
)
public
Map
Test
(){
CloseableHttpClient
httpClinet
=
shengneiUtil
.
createSSLClientDefault
();
/*String token = getToken(httpClinet);
System.out.println(token);
JSONObject parseObject = JSON.parseObject(token);*/
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
String
da
=
sdf
.
format
(
date
);
String
url
=
"https://gateway.zsj.jl.cegn.cn/api/visual/queryEBaseinfos"
;
JSONObject
obj
=
new
JSONObject
();
String
doPost
=
shengneiUtil
.
doPost
(
url
,
obj
.
toString
(),
"514f30bb290b875cf718ef0f10886c15"
,
httpClinet
);
logger
.
info
(
doPost
);
return
new
HashMap
<>();
}
@ApiOperation
(
value
=
"查询企业信息接口流水"
)
@GetMapping
@PreAuthorize
(
"@el.check('serverDeploy:list')"
)
public
ResponseEntity
<
Object
>
query
(
LxjcjyDeployQueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
<>(
lxjcjyService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/domain/JczlcxDeploy.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
domain
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseEntity
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.sql.Date
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
@Entity
@Getter
@Setter
@Table
(
name
=
"SJGX_BDC313_JCZLCX"
)
public
class
JczlcxDeploy
extends
BaseEntity
implements
Serializable
{
@Id
@Column
(
name
=
"ID"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
@SequenceGenerator
(
name
=
"JczlcxDeployGenerator"
,
sequenceName
=
"SEQ_SJGX_BDC313_JCZLCX"
,
allocationSize
=
1
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
,
generator
=
"JczlcxDeployGenerator"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"证件类型"
)
private
String
zjlx
;
@ApiModelProperty
(
value
=
"证件号码"
)
private
String
zjhm
;
@ApiModelProperty
(
value
=
"备用字段1"
)
private
String
bk1
;
@ApiModelProperty
(
value
=
"备用字段2"
)
private
String
bk2
;
@ApiModelProperty
(
value
=
"备用字段3"
)
private
String
bk3
;
@ApiModelProperty
(
value
=
"备用字段4"
)
private
String
bk4
;
@ApiModelProperty
(
value
=
"备用字段5"
)
private
String
bk5
;
@ApiModelProperty
(
value
=
"处理状态"
)
private
String
fileserverstat
;
@ApiModelProperty
(
value
=
"失败原因"
)
private
String
errorreason
;
@ApiModelProperty
(
value
=
"返回报文:备用字段1"
)
private
String
rbk1
;
@ApiModelProperty
(
value
=
"返回报文:备用字段2"
)
private
String
rbk2
;
@ApiModelProperty
(
value
=
"0 待发送 1 已发送 2 已接受结果 "
)
private
String
status
;
@ApiModelProperty
(
value
=
"插入日期"
)
private
Date
crrq
;
@ApiModelProperty
(
value
=
"返回日期"
)
private
Date
fhrq
;
@ApiModelProperty
(
value
=
"报文头返回状态 0 成功 1失败 "
)
private
String
txstatus
;
@ApiModelProperty
(
value
=
"报文头返回解释"
)
private
String
rtnmessage
;
@ApiModelProperty
(
value
=
"发送方日期"
)
private
String
senddate
;
@ApiModelProperty
(
value
=
"发送方时间"
)
private
String
sendtime
;
@ApiModelProperty
(
value
=
"发送方流水号"
)
private
String
sendseqno
;
@ApiModelProperty
(
value
=
"交易机构号"
)
private
String
txunitno
;
@ApiModelProperty
(
value
=
"发送方节点号"
)
private
String
sendnode
;
@ApiModelProperty
(
value
=
"交易代码"
)
private
String
txcode
;
@ApiModelProperty
(
value
=
"接收方节点号"
)
private
String
receivenode
;
@ApiModelProperty
(
value
=
"客户编号"
)
private
String
custno
;
@ApiModelProperty
(
value
=
"发送方流水号"
)
private
String
operno
;
@ApiModelProperty
(
value
=
""
)
private
String
rtncode
;
@ApiModelProperty
(
value
=
"返回报文头日期"
)
private
String
receivedate
;
@ApiModelProperty
(
value
=
"返回报文头时间"
)
private
String
receivetime
;
@ApiModelProperty
(
value
=
"返回报文流水号"
)
private
String
receiveseqno
;
@ApiModelProperty
(
value
=
"姓名"
)
private
String
xingming
;
@ApiModelProperty
(
value
=
"缴存账户状态"
)
private
String
jczhzt
;
@ApiModelProperty
(
value
=
"返回报文:数据总条数"
)
private
String
recnum
;
@ApiModelProperty
(
value
=
"返回报文:备用字段3"
)
private
String
rbk3
;
@ApiModelProperty
(
value
=
"返回报文:备用字段4"
)
private
String
rbk4
;
@ApiModelProperty
(
value
=
"返回报文:备用字段5"
)
private
String
rbk5
;
public
void
copy
(
JczlcxDeploy
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/domain/LxjcjyDeploy.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
domain
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
me.zhengjie.base.BaseEntity
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.sql.Date
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
@Entity
@Getter
@Setter
@Table
(
name
=
"SJGX_BDC315_LXJCJY"
)
public
class
LxjcjyDeploy
extends
BaseEntity
implements
Serializable
{
@Id
@Column
(
name
=
"ID"
)
@ApiModelProperty
(
value
=
"ID"
,
hidden
=
true
)
@SequenceGenerator
(
name
=
"LxjcjyDeployGenerator"
,
sequenceName
=
"SEQ_SJGX_BDC315_LXJCJY"
,
allocationSize
=
1
)
@GeneratedValue
(
strategy
=
GenerationType
.
SEQUENCE
,
generator
=
"LxjcjyDeployGenerator"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"证件类型"
)
private
String
zjlx
;
public
void
copy
(
LxjcjyDeploy
source
){
BeanUtil
.
copyProperties
(
source
,
this
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
));
}
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/mapper/JczlcxMapper.java
0 → 100644
View file @
7704443a
package
me
.
zhengjie
.
mapper
;
import
me.zhengjie.base.BaseMapper
;
import
me.zhengjie.domain.JczlcxDeploy
;
import
me.zhengjie.domain.QyxxcxDeploy
;
import
me.zhengjie.service.dto.JczlcxDeployDto
;
import
me.zhengjie.service.dto.QyxxcxDeployDto
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
{},
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
JczlcxMapper
extends
BaseMapper
<
JczlcxDeployDto
,
JczlcxDeploy
>
{
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/mapper/LxjcjyMapper.java
0 → 100644
View file @
7704443a
package
me
.
zhengjie
.
mapper
;
import
me.zhengjie.base.BaseMapper
;
import
me.zhengjie.domain.JczlcxDeploy
;
import
me.zhengjie.domain.LxjcjyDeploy
;
import
me.zhengjie.service.dto.JczlcxDeployDto
;
import
me.zhengjie.service.dto.LxjcjyDeployDto
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
{},
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
LxjcjyMapper
extends
BaseMapper
<
LxjcjyDeployDto
,
LxjcjyDeploy
>
{
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/repository/JczlcxDeployRepository.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
repository
;
import
me.zhengjie.domain.JczlcxDeploy
;
import
me.zhengjie.domain.QyxxcxDeploy
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
public
interface
JczlcxDeployRepository
extends
JpaRepository
<
JczlcxDeploy
,
Long
>,
JpaSpecificationExecutor
<
JczlcxDeploy
>
{
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/repository/LxjcjyDeployRepository.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
repository
;
import
me.zhengjie.domain.JczlcxDeploy
;
import
me.zhengjie.domain.LxjcjyDeploy
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
public
interface
LxjcjyDeployRepository
extends
JpaRepository
<
LxjcjyDeploy
,
Long
>,
JpaSpecificationExecutor
<
LxjcjyDeploy
>
{
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/service/JczlcxService.java
0 → 100644
View file @
7704443a
package
me
.
zhengjie
.
service
;
import
me.zhengjie.service.dto.JczlcxDeployQueryCriteria
;
import
me.zhengjie.service.dto.QyxxcxDeployQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
public
interface
JczlcxService
{
/**
* 分页查询
* @param criteria 条件
* @param pageable 分页参数
* @return /
*/
Object
queryAll
(
JczlcxDeployQueryCriteria
criteria
,
Pageable
pageable
);
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/service/LxjcjyService.java
0 → 100644
View file @
7704443a
package
me
.
zhengjie
.
service
;
import
me.zhengjie.service.dto.JczlcxDeployQueryCriteria
;
import
me.zhengjie.service.dto.LxjcjyDeployQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
public
interface
LxjcjyService
{
/**
* 分页查询
* @param criteria 条件
* @param pageable 分页参数
* @return /
*/
Object
queryAll
(
LxjcjyDeployQueryCriteria
criteria
,
Pageable
pageable
);
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/service/dto/JczlcxDeployDto.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
service
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
me.zhengjie.base.BaseDTO
;
import
java.io.Serializable
;
import
java.sql.Date
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
@Data
public
class
JczlcxDeployDto
extends
BaseDTO
implements
Serializable
{
private
Long
id
;
private
String
zjlx
;
private
String
zjhm
;
private
String
bk1
;
private
String
bk2
;
private
String
bk3
;
private
String
bk4
;
private
String
bk5
;
private
String
fileserverstat
;
private
String
errorreason
;
private
String
rbk1
;
private
String
rbk2
;
private
String
status
;
private
Date
crrq
;
private
Date
fhrq
;
private
String
txstatus
;
private
String
rtnmessage
;
private
String
senddate
;
private
String
sendtime
;
private
String
sendseqno
;
private
String
txunitno
;
private
String
sendnode
;
private
String
txcode
;
private
String
receivenode
;
private
String
custno
;
private
String
operno
;
private
String
rtncode
;
private
String
receivedate
;
private
String
receivetime
;
private
String
receiveseqno
;
private
String
xingming
;
private
String
jczhzt
;
private
String
recnum
;
private
String
rbk3
;
private
String
rbk4
;
private
String
rbk5
;
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/service/dto/JczlcxDeployQueryCriteria.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
service
.
dto
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
@Data
public
class
JczlcxDeployQueryCriteria
{
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/service/dto/LxjcjyDeployDto.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
service
.
dto
;
import
lombok.Data
;
import
me.zhengjie.base.BaseDTO
;
import
java.io.Serializable
;
import
java.sql.Date
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
@Data
public
class
LxjcjyDeployDto
extends
BaseDTO
implements
Serializable
{
private
Long
id
;
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/service/dto/LxjcjyDeployQueryCriteria.java
0 → 100644
View file @
7704443a
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
me
.
zhengjie
.
service
.
dto
;
import
lombok.Data
;
/**
* @author zhanghouying
* @date 2019-08-24
*/
@Data
public
class
LxjcjyDeployQueryCriteria
{
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/serviceimpl/JczlcxServiceImpl.java
0 → 100644
View file @
7704443a
package
me
.
zhengjie
.
serviceimpl
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.domain.JczlcxDeploy
;
import
me.zhengjie.domain.QyxxcxDeploy
;
import
me.zhengjie.mapper.JczlcxMapper
;
import
me.zhengjie.mapper.QyxxcxMapper
;
import
me.zhengjie.repository.JczlcxDeployRepository
;
import
me.zhengjie.repository.QyxxcxDeployRepository
;
import
me.zhengjie.service.JczlcxService
;
import
me.zhengjie.service.QyxxcxService
;
import
me.zhengjie.service.dto.JczlcxDeployQueryCriteria
;
import
me.zhengjie.service.dto.QyxxcxDeployQueryCriteria
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.utils.QueryHelp
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
/**
* @author JiangHeJia
* @version V1.0
* @Title: QyxxcxServiceImpl
* @Package eladmin
* @Description: TODO(查询企业信息接口流水实现类)
* @date 2021/9/26 15:33
*/
@Service
@RequiredArgsConstructor
public
class
JczlcxServiceImpl
implements
JczlcxService
{
private
final
JczlcxDeployRepository
jczlcxDeployRepository
;
private
final
JczlcxMapper
jczlcxMapper
;
@Override
public
Object
queryAll
(
JczlcxDeployQueryCriteria
criteria
,
Pageable
pageable
){
Page
<
JczlcxDeploy
>
page
=
jczlcxDeployRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
);
return
PageUtil
.
toPage
(
page
.
map
(
jczlcxMapper:
:
toDto
));
}
}
eladmin/eladmin-interface/src/main/java/me/zhengjie/serviceimpl/LxjcjyServiceImpl.java
0 → 100644
View file @
7704443a
package
me
.
zhengjie
.
serviceimpl
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.domain.LxjcjyDeploy
;
import
me.zhengjie.mapper.LxjcjyMapper
;
import
me.zhengjie.repository.LxjcjyDeployRepository
;
import
me.zhengjie.service.LxjcjyService
;
import
me.zhengjie.service.dto.LxjcjyDeployQueryCriteria
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.utils.QueryHelp
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
/**
* @author JiangHeJia
* @version V1.0
* @Title: QyxxcxServiceImpl
* @Package eladmin
* @Description: TODO(查询企业信息接口流水实现类)
* @date 2021/9/26 15:33
*/
@Service
@RequiredArgsConstructor
public
class
LxjcjyServiceImpl
implements
LxjcjyService
{
private
final
LxjcjyDeployRepository
lxjcjyDeployRepository
;
private
final
LxjcjyMapper
lxjcjyMapper
;
@Override
public
Object
queryAll
(
LxjcjyDeployQueryCriteria
criteria
,
Pageable
pageable
){
Page
<
LxjcjyDeploy
>
page
=
lxjcjyDeployRepository
.
findAll
((
root
,
criteriaQuery
,
criteriaBuilder
)
->
QueryHelp
.
getPredicate
(
root
,
criteria
,
criteriaBuilder
),
pageable
);
return
PageUtil
.
toPage
(
page
.
map
(
lxjcjyMapper:
:
toDto
));
}
}
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