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
bcf9ac9a
Commit
bcf9ac9a
authored
Oct 20, 2021
by
JiangSN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
缴存总览查询crud改为公共方法
parent
604ba8f5
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
101 additions
and
1258 deletions
+101
-1258
PanelGroup.vue
eladmin-web/src/views/dashboard/PanelGroup.vue
+22
-14
CRUD.operation.vue
eladmin-web/src/views/polling/jczlcx/Crud/CRUD.operation.vue
+0
-204
Pagination.vue
eladmin-web/src/views/polling/jczlcx/Crud/Pagination.vue
+0
-18
RR.operation.vue
eladmin-web/src/views/polling/jczlcx/Crud/RR.operation.vue
+0
-20
UD.operation.vue
eladmin-web/src/views/polling/jczlcx/Crud/UD.operation.vue
+0
-74
crud.js
eladmin-web/src/views/polling/jczlcx/Crud/crud.js
+0
-863
index.vue
eladmin-web/src/views/polling/jczlcx/index.vue
+55
-48
JczlcxController.java
...rc/main/java/me/zhengjie/controller/JczlcxController.java
+10
-11
JczlcxService.java
...ness/src/main/java/me/zhengjie/service/JczlcxService.java
+4
-1
JczlcxServiceImpl.java
.../main/java/me/zhengjie/serviceimpl/JczlcxServiceImpl.java
+10
-5
No files found.
eladmin-web/src/views/dashboard/PanelGroup.vue
View file @
bcf9ac9a
...
...
@@ -3,41 +3,39 @@
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('newVisitis')"
>
<div
class=
"card-panel-icon-wrapper icon-people"
>
<!--
<svg-icon
icon-class=
"peoples"
class-name=
"card-panel-icon"
/>
-->
<svg-icon
icon-class=
"visits"
class-name=
"card-panel-icon"
/>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
接口访问总
量
每日访问
量
</div>
<count-to
:start-val=
"0"
:end-val=
"
102400
"
:duration=
"2600"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
this.visits
"
:duration=
"2600"
class=
"card-panel-num"
/>
</div>
</div>
</el-col>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('messages')"
>
<div
class=
"card-panel-icon-wrapper icon-message"
>
<!--
<svg-icon
icon-class=
"message"
class-name=
"card-panel-icon"
/>
-->
<svg-icon
icon-class=
"tree"
class-name=
"card-panel-icon"
/>
<div
class=
"card-panel-icon-wrapper icon-people"
>
<svg-icon
icon-class=
"visits"
class-name=
"card-panel-icon"
/>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
任务调度
每月访问量
</div>
<count-to
:start-val=
"0"
:end-val=
"
81212
"
:duration=
"3000"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
this.totalview
"
:duration=
"3000"
class=
"card-panel-num"
/>
</div>
</div>
</el-col>
<el-col
:xs=
"12"
:sm=
"12"
:lg=
"6"
class=
"card-panel-col"
>
<div
class=
"card-panel"
@
click=
"handleSetLineChartData('purchases')"
>
<div
class=
"card-panel-icon-wrapper icon-m
oney
"
>
<svg-icon
icon-class=
"
money"
class-name=
"card-panel-icon"
/>
<div
class=
"card-panel-icon-wrapper icon-m
essage
"
>
<svg-icon
icon-class=
"
tree"
class-name=
"card-panel-icon"
/>
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
Purchases
任务调度
</div>
<count-to
:start-val=
"0"
:end-val=
"
9280
"
:duration=
"3200"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
'----'
"
:duration=
"3200"
class=
"card-panel-num"
/>
</div>
</div>
</el-col>
...
...
@@ -48,9 +46,9 @@
</div>
<div
class=
"card-panel-description"
>
<div
class=
"card-panel-text"
>
Shoppings
</div>
<count-to
:start-val=
"0"
:end-val=
"
13600
"
:duration=
"3600"
class=
"card-panel-num"
/>
<count-to
:start-val=
"0"
:end-val=
"
'----'
"
:duration=
"3600"
class=
"card-panel-num"
/>
</div>
</div>
</el-col>
...
...
@@ -61,6 +59,16 @@
import
CountTo
from
'vue-count-to'
export
default
{
props
:
{
visits
:
{
type
:
String
,
default
:
0
},
totalview
:
{
type
:
String
,
default
:
0
},
},
components
:
{
CountTo
},
...
...
eladmin-web/src/views/polling/jczlcx/Crud/CRUD.operation.vue
deleted
100644 → 0
View file @
604ba8f5
<
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
deleted
100644 → 0
View file @
604ba8f5
<!--分页-->
<
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
deleted
100644 → 0
View file @
604ba8f5
<!--搜索与重置-->
<
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
deleted
100644 → 0
View file @
604ba8f5
<
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
deleted
100644 → 0
View file @
604ba8f5
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
View file @
bcf9ac9a
...
...
@@ -12,26 +12,26 @@
</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-form
ref=
"form"
:
disabled=
"crud.status.CHECK"
:
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=
"zjlx"
>
<el-input
v-model=
"form.zjlx"
style=
"width: 370px"
:disabled=
"true"
/>
<el-input
v-model=
"form.zjlx"
style=
"width: 370px"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple-light"
>
<el-form-item
label=
"证件号码"
prop=
"zjhm"
>
<el-input
v-model=
"form.zjhm"
style=
"width: 370px"
:disabled=
"true"
/>
<el-input
v-model=
"form.zjhm"
style=
"width: 370px"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-input
v-model=
"form.status"
type=
"textarea"
style=
"width: 370px"
:disabled=
"true"
/>
<el-input
v-model=
"form.status"
type=
"textarea"
style=
"width: 370px"
/>
</el-form-item>
</div>
</el-col>
...
...
@@ -40,13 +40,13 @@
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"姓名"
prop=
"xingming"
>
<el-input
v-model
.
number=
"form.xingming"
style=
"width: 370px;"
:disabled=
"true"
/>
<el-input
v-model
.
number=
"form.xingming"
style=
"width: 370px;"
/>
</el-form-item>
</div>
</el-col>
<el-col
:span=
"8"
>
<el-form-item
label=
"插入日期"
prop=
"crrq"
>
<el-input
v-model
.
number=
"form.crrq"
style=
"width: 370px;"
:disabled=
"true"
/>
<el-input
v-model
.
number=
"form.crrq"
style=
"width: 370px;"
/>
</el-form-item>
<div
class=
"grid-content bg-purple-light"
/>
</el-col>
...
...
@@ -55,22 +55,22 @@
<el-row
:gutter=
"20"
>
<el-col
:span=
"8"
>
<div
class=
"grid-content bg-purple"
>
<el-form-item
label=
"
证件类型"
prop=
"zjlx
"
>
<el-input
v-model=
"form.
zjlx"
style=
"width: 370px"
:disabled=
"true
"
/>
<el-form-item
label=
"
开户中心编号"
prop=
"KHZXBH
"
>
<el-input
v-model=
"form.
KHZXBH"
style=
"width: 370px
"
/>
</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
label=
"
开户中心名称"
prop=
"KHZXMC
"
>
<el-input
v-model=
"form.
KHZXMC"
style=
"width: 370px
"
/>
</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
label=
"
单位账号"
prop=
"DWZH
"
>
<el-input
v-model=
"form.
DWZH"
style=
"width: 370px
"
/>
</el-form-item>
</div>
</el-col>
...
...
@@ -78,22 +78,22 @@
<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
label=
"
个人账号"
prop=
"GRZH
"
>
<el-input
v-model=
"form.
GRZH"
style=
"width: 370px
"
/>
</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
label=
"
个人账户状态"
prop=
"GRZHZT
"
>
<el-input
v-model=
"form.
GRZHZT"
style=
"width: 370px
"
/>
</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
label=
"
数据插入日期"
prop=
"CRRQ
"
>
<el-input
v-model=
"form.
CRRQ"
style=
"width: 370px
"
/>
</el-form-item>
</div>
</el-col>
...
...
@@ -101,38 +101,20 @@
<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
label=
"
报文返回日期"
prop=
"ZXZWRQ
"
>
<el-input
v-model=
"form.
ZXZWRQ"
style=
"width: 370px
"
/>
</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>
...
...
@@ -140,10 +122,11 @@
</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"
>
<el-table-column
v-if=
"checkPer(['admin','serverDeploy:
check
'])"
label=
"操作"
width=
"150px"
align=
"center"
>
<template
slot-scope=
"scope"
>
<
udOperation
<
Retrieve
:data=
"scope.row"
:queryList=
"queryList"
:permission=
"permission"
/>
</
template
>
...
...
@@ -163,23 +146,39 @@
<
script
>
import
{
testServerConnect
}
from
'@/api/mnt/connect'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'
./C
rud/crud'
import
rrOperation
from
'
./C
rud/RR.operation'
import
udOperation
from
'
./C
rud/UD.operation'
import
pagination
from
'
./C
rud/Pagination'
import
CRUD
,
{
presenter
,
header
,
form
,
crud
}
from
'
@c
rud/crud'
import
rrOperation
from
'
@c
rud/RR.operation'
import
udOperation
from
'
@c
rud/UD.operation'
import
pagination
from
'
@c
rud/Pagination'
import
DateRangePicker
from
'@/components/DateRangePicker'
import
crudOperation
from
'
./C
rud/CRUD.operation'
import
crudOperation
from
'
@c
rud/CRUD.operation'
import
Retrieve
from
"@crud/Retrieve"
;
const
defaultForm
=
{
id
:
null
,
name
:
null
,
ip
:
null
,
port
:
22
,
account
:
'root'
,
password
:
null
}
export
default
{
name
:
'Jczlcx'
,
components
:
{
pagination
,
rrOperation
,
udOperation
,
DateRangePicker
,
crudOperation
},
components
:
{
Retrieve
,
pagination
,
rrOperation
,
udOperation
,
DateRangePicker
,
crudOperation
},
cruds
()
{
return
CRUD
({
title
:
'缴存总览详情'
,
url
:
'api/JczlcxController'
,
crudMethod
:
{}})
return
CRUD
({
title
:
'缴存总览详情'
,
url
:
'api/JczlcxController'
,
optShow
:
{
add
:
false
,
edit
:
false
,
del
:
false
,
download
:
false
,
reset
:
true
},
})
},
mixins
:
[
presenter
(),
header
(),
form
(
defaultForm
),
crud
()],
data
()
{
return
{
//明细请求参数
queryList
:
{
status
:
true
,
url
:
"api/JczlcxController/QueryJczlcxFhmx"
,
id
:
""
},
// currView: 'index',
accountList
:
[],
accountMap
:
{},
...
...
@@ -194,6 +193,14 @@ export default {
}
},
methods
:
{
testDigSeven
(
val
){
console
.
log
(
"val:"
+
val
)
// this.queryList.push(val)
this
.
$http
.
get
(
"http://localhost:8013/api/JczlcxController/QueryJczlcxFhmx?id="
+
val
.
id
).
then
(
function
(
res
)
{
// console.log("this.queryList:"+ this.queryList)
// this.queryList.push(res.body.data[0])
});
},
testConnectServer
()
{
this
.
$refs
[
'form'
].
validate
((
valid
)
=>
{
if
(
valid
)
{
...
...
eladmin/eladmin-business/src/main/java/me/zhengjie/controller/JczlcxController.java
View file @
bcf9ac9a
...
...
@@ -15,19 +15,12 @@
*/
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
me.zhengjie.util.R
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
...
...
@@ -35,11 +28,10 @@ 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.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
//import static me.zhengjie.util.shengneiUtil.createSSLClientDefault;
...
...
@@ -64,4 +56,11 @@ public class JczlcxController {
public
ResponseEntity
<
Object
>
query
(
JczlcxDeployQueryCriteria
criteria
,
Pageable
pageable
){
return
new
ResponseEntity
<>(
jczlcxService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
}
@ApiOperation
(
"缴存总览查询返回明细"
)
@RequestMapping
(
"/QueryJczlcxFhmx"
)
public
R
QueryJczlcxFhmx
(
@RequestParam
(
"id"
)
String
id
)
{
List
<
Map
>
visits
=
jczlcxService
.
QueryJczlcxFhmx
(
id
);
return
new
R
<>(
visits
);
}
}
eladmin/eladmin-business/src/main/java/me/zhengjie/service/JczlcxService.java
View file @
bcf9ac9a
package
me
.
zhengjie
.
service
;
import
me.zhengjie.service.dto.JczlcxDeployQueryCriteria
;
import
me.zhengjie.service.dto.QyxxcxDeployQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
import
java.util.List
;
import
java.util.Map
;
public
interface
JczlcxService
{
/**
* 分页查询
...
...
@@ -13,4 +15,5 @@ public interface JczlcxService {
*/
Object
queryAll
(
JczlcxDeployQueryCriteria
criteria
,
Pageable
pageable
);
List
<
Map
>
QueryJczlcxFhmx
(
String
id
);
}
eladmin/eladmin-business/src/main/java/me/zhengjie/serviceimpl/JczlcxServiceImpl.java
View file @
bcf9ac9a
package
me
.
zhengjie
.
serviceimpl
;
import
lombok.RequiredArgsConstructor
;
import
me.zhengjie.MybatisMapper.JczlcxMybatisMapper
;
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
;
import
java.util.List
;
import
java.util.Map
;
/**
* @author Jing Xiduo
* @date 2021-10-18
...
...
@@ -27,9 +26,15 @@ public class JczlcxServiceImpl implements JczlcxService {
private
final
JczlcxDeployRepository
jczlcxDeployRepository
;
private
final
JczlcxMapper
jczlcxMapper
;
private
final
JczlcxMybatisMapper
jczlcxMybatisMapper
;
@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
));
}
@Override
public
List
<
Map
>
QueryJczlcxFhmx
(
String
id
)
{
return
jczlcxMybatisMapper
.
QueryJczlcxFhmx
(
id
);
}
}
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