Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Z
zentao-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zentao
zentao-view
Commits
a01ecd68
Commit
a01ecd68
authored
Mar 03, 2021
by
王鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 年度列表
parent
6e429f90
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
94 additions
and
30 deletions
+94
-30
holidays.js
src/api/holidays/holidays.js
+20
-1
global.js
src/util/global.js
+4
-0
HolidaysList.vue
src/views/holidays/HolidaysList.vue
+70
-29
No files found.
src/api/holidays/holidays.js
View file @
a01ecd68
...
@@ -2,7 +2,9 @@ import {axios} from '@/util/axios/request'
...
@@ -2,7 +2,9 @@ import {axios} from '@/util/axios/request'
const
api
=
{
const
api
=
{
getPage
:
'/holidays/page'
,
getPage
:
'/holidays/page'
,
synchronousVacation
:
'/holidays/synchronousVacation'
synchronousVacation
:
'/holidays/synchronousVacation'
,
deleteHoliday
:
'/holidays/'
,
batchDeleteHoliday
:
'/holidays/batchDelete'
}
}
export
default
api
export
default
api
...
@@ -23,4 +25,21 @@ export function synchronousVacation(parameter) {
...
@@ -23,4 +25,21 @@ export function synchronousVacation(parameter) {
data
:
parameter
,
data
:
parameter
,
useFullLoading
:
true
useFullLoading
:
true
})
})
}
export
function
deleteHoliday
(
parameter
)
{
return
axios
({
url
:
api
.
deleteHoliday
+
parameter
,
method
:
'delete'
,
useFullLoading
:
true
})
}
export
function
batchDeleteHoliday
(
parameter
)
{
return
axios
({
url
:
api
.
batchDeleteHoliday
,
method
:
'post'
,
data
:
parameter
,
useFullLoading
:
true
})
}
}
\ No newline at end of file
src/util/global.js
View file @
a01ecd68
...
@@ -49,6 +49,10 @@ window.SYS_CONST = {
...
@@ -49,6 +49,10 @@ window.SYS_CONST = {
MALE
:
1
,
MALE
:
1
,
FEMALE
:
2
,
FEMALE
:
2
,
OTHER
:
3
OTHER
:
3
},
HOLIDAY_TYPE
:
{
//假期类型 1.节假日 2.双休日
HOLIDAY
:
1
,
WEEKEND
:
2
}
}
}
}
...
...
src/views/holidays/HolidaysList.vue
View file @
a01ecd68
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
<a-form
layout=
"horizontal"
class=
"ant-advanced-search-form"
>
<a-form
layout=
"horizontal"
class=
"ant-advanced-search-form"
>
<div>
<div>
<a-row>
<a-row>
<a-col
:span=
"
6
"
>
<a-col
:span=
"
4
"
>
<a-form-item
label=
"年度"
:labelCol=
"
{span: 8}" :wrapperCol="{span: 16}">
<a-form-item
label=
"年度"
:labelCol=
"
{span: 8}" :wrapperCol="{span: 16}">
<a-select
placeholder=
"请选择年度"
v-model=
"query.year"
:allowClear=
"true"
@
change=
"search"
>
<a-select
placeholder=
"请选择年度"
v-model=
"query.year"
:allowClear=
"true"
@
change=
"search"
>
<a-select-option
v-for=
"year in yearList"
v-bind:value=
"year.id"
v-bind:key=
"year.id"
>
<a-select-option
v-for=
"year in yearList"
v-bind:value=
"year.id"
v-bind:key=
"year.id"
>
...
@@ -28,14 +28,25 @@
...
@@ -28,14 +28,25 @@
size=
"middle"
size=
"middle"
:columns=
"columns"
:columns=
"columns"
:dataSource=
"dataSource"
:dataSource=
"dataSource"
:row-selection=
"
rowSelection
"
:row-selection=
"
{selectedRowKeys: selectedRowKeys, onChange: updateSelect}
"
:loading="tableLoading"
:loading="tableLoading"
:rowKey="rowKey"
:rowKey="rowKey"
:pagination="false"
:pagination="false"
bordered
bordered
>
>
<div
slot=
"title"
slot-scope=
"data"
>
<span
class=
"cust-title"
>
<a-icon
type=
"hdd"
/>
假期管理列表
{{
data
.
none
}}
</span>
<div
class=
"cust-table-operator"
>
<a-button-group>
<a-button
type=
"primary"
>
新建
</a-button>
<a-button
@
click=
"onBatchDelete"
type=
"danger"
>
批量删除
</a-button>
</a-button-group>
</div>
</div>
<span
slot=
"dayCode"
slot-scope=
"text"
>
<span
slot=
"dayCode"
slot-scope=
"text"
>
{{
findItem
(
holidayTypes
,
'valueInt'
,
text
)[
0
][
'name'
]
}}
{{
(
findItem
(
holidayTypes
,
'valueInt'
,
text
)[
0
]
||
{
}
).
name
}}
<
/span
>
<
/span
>
<
span
slot
=
"duration"
slot
-
scope
=
"text"
>
<
span
slot
=
"duration"
slot
-
scope
=
"text"
>
{{
text
}}
天
{{
text
}}
天
...
@@ -43,7 +54,13 @@
...
@@ -43,7 +54,13 @@
<
span
slot
=
"action"
slot
-
scope
=
"text, record"
>
<
span
slot
=
"action"
slot
-
scope
=
"text, record"
>
<
a
>
编辑
<
/a
>
<
a
>
编辑
<
/a
>
<
a
-
divider
type
=
"vertical"
/>
<
a
-
divider
type
=
"vertical"
/>
<a
style=
"color: red"
>
删除
</a>
<
a
-
popconfirm
v
-
if
=
"dataSource.length"
title
=
"确定删除?"
@
confirm
=
"() => onDelete(record.id)"
>
<
a
style
=
"color: red"
>
删除
<
/a
>
<
/a-popconfirm
>
<
/span
>
<
/span
>
<
span
slot
=
"startDate"
slot
-
scope
=
"text"
>
<
span
slot
=
"startDate"
slot
-
scope
=
"text"
>
{{
timestampToTime
(
text
)
}}
{{
timestampToTime
(
text
)
}}
...
@@ -70,7 +87,7 @@
...
@@ -70,7 +87,7 @@
<
/template
>
<
/template
>
<
script
>
<
script
>
import
{
getCommonCode
}
from
"@api/system/sysCode"
;
import
{
getCommonCode
}
from
"@api/system/sysCode"
;
import
{
getPage
,
synchronousVacation
}
from
"@api/holidays/holidays"
;
import
{
getPage
,
synchronousVacation
,
deleteHoliday
,
batchDeleteHoliday
}
from
"@api/holidays/holidays"
;
const
columns
=
[
const
columns
=
[
{
title
:
'名称'
,
width
:
100
,
dataIndex
:
'name'
}
,
{
title
:
'名称'
,
width
:
100
,
dataIndex
:
'name'
}
,
...
@@ -83,44 +100,25 @@ const columns = [
...
@@ -83,44 +100,25 @@ const columns = [
]
]
const
dataSource
=
[]
const
dataSource
=
[]
const
rowSelection
=
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
console
.
log
(
`selectedRowKeys:
${
selectedRowKeys
}
`
,
'selectedRows: '
,
selectedRows
);
},
onSelect
:
(
record
,
selected
,
selectedRows
)
=>
{
console
.
log
(
record
,
selected
,
selectedRows
);
},
onSelectAll
:
(
selected
,
selectedRows
,
changeRows
)
=>
{
console
.
log
(
selected
,
selectedRows
,
changeRows
);
}
}
export
default
{
export
default
{
name
:
'HolidaysList'
,
name
:
'HolidaysList'
,
data
()
{
data
()
{
return
{
return
{
query
:
{
query
:
{
year
:
202
0
,
year
:
0
,
page
:
1
,
page
:
1
,
size
:
10
size
:
10
}
,
}
,
yearList
:[
yearList
:[],
{
id
:
2020
,
name
:
"2020年"
},
{
id
:
2021
,
name
:
"2021年"
}
],
loading
:
false
,
loading
:
false
,
columns
:
columns
,
columns
:
columns
,
rowSelection
:
rowSelection
,
selectedRowKeys
:[]
,
dataSource
:
dataSource
,
dataSource
:
dataSource
,
holidayTypes
:[],
holidayTypes
:[],
tableLoading
:
false
,
tableLoading
:
false
,
isFirstLoad
:
true
,
isFirstLoad
:
true
,
rowKey
:
"id"
,
total
:
0
}
}
}
,
}
,
computed
:
{
computed
:
{
...
@@ -182,9 +180,52 @@ export default {
...
@@ -182,9 +180,52 @@ export default {
}
}
this
.
loading
=
false
this
.
loading
=
false
}
);
}
);
}
,
onDelete
(
id
){
deleteHoliday
(
id
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
){
this
.
loadData
()
}
}
)
}
,
updateSelect
(
selectedRowKeys
)
{
this
.
selectedRowKeys
=
selectedRowKeys
}
,
onBatchDelete
(){
if
(
this
.
selectedRowKeys
.
length
==
0
)
{
return
;
}
let
_this
=
this
this
.
$confirm
({
title
:
'提示'
,
content
:
'确定删除选中的记录吗?'
,
onOk
()
{
batchDeleteHoliday
(
_this
.
selectedRowKeys
).
then
(
response
=>
{
if
(
response
&&
response
.
code
==
SYS_CONST
.
REQUEST
.
SUCCEED
){
_this
.
loadData
()
}
}
)
}
,
onCancel
()
{
}
,
}
);
}
,
initYears
(){
let
date
=
new
Date
();
let
baseyear
=
2020
;
let
current
=
date
.
getFullYear
();
//获取完整的年份(4位)
console
.
log
(
current
)
for
(
let
i
=
baseyear
;
i
<
(
current
+
2
);
i
++
){
this
.
yearList
.
push
({
id
:
i
,
name
:
i
+
'年'
}
)
}
this
.
query
.
year
=
current
}
}
}
,
}
,
mounted
()
{
mounted
()
{
this
.
initYears
()
this
.
getHolidayType
()
this
.
getHolidayType
()
if
(
this
.
isFirstLoad
==
true
)
{
if
(
this
.
isFirstLoad
==
true
)
{
this
.
loadData
(
this
.
defaultPageSize
)
this
.
loadData
(
this
.
defaultPageSize
)
...
...
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