Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fengzhaoyu
schedule
Commits
c3cb55a9
Commit
c3cb55a9
authored
Apr 14, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9a3126f4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
21 deletions
+33
-21
taskList.js
components/taskList/taskList.js
+0
-1
schedule.js
pages/scheduleList/schedule.js
+5
-2
scheduleList.js
pages/scheduleList/scheduleList.js
+25
-18
utils.js
utils/utils.js
+3
-0
No files found.
components/taskList/taskList.js
View file @
c3cb55a9
...
...
@@ -7,7 +7,6 @@ Component({
isCanEdit
:
true
},
didMount
()
{
console
.
log
(
this
.
props
.
taskList
,
1111
)
},
didUpdate
()
{
},
...
...
pages/scheduleList/schedule.js
View file @
c3cb55a9
...
...
@@ -38,11 +38,14 @@ export function getExcludeDate(data = []) {
// 返回跨天数
export
function
getNextDateList
(
startTime
,
endTime
)
{
// if (startTime.getTime() == new Date('2020/4/15 23:55').getTime()) {
// debugger
// }
let
days
=
0
;
const
nextDateList
=
[];
if
(
startTime
.
getDate
()
!==
endTime
.
getDate
())
{
//同一个月
if
(
startTime
.
getMonth
()
!
==
endTime
.
getMonth
())
{
if
(
startTime
.
getMonth
()
==
endTime
.
getMonth
())
{
days
=
endTime
.
getDate
()
-
startTime
.
getDate
();
}
//跨月
...
...
@@ -55,7 +58,7 @@ export function getNextDateList(startTime, endTime) {
//跨一个月 不考虑
}
//返回跨天的日期数组
for
(
let
i
=
1
;
i
<=
days
;
i
++
)
{
for
(
let
i
=
0
;
i
<=
days
;
i
++
)
{
const
newDate
=
new
Date
(
startTime
);
const
nextDate
=
toLocaleDateString
(
new
Date
(
newDate
.
setDate
(
newDate
.
getDate
()
+
i
)));
nextDateList
.
push
(
nextDate
)
...
...
pages/scheduleList/scheduleList.js
View file @
c3cb55a9
...
...
@@ -241,7 +241,8 @@ create.Page({
thisDayEndTime
:
getFormatDate
(
endTime
,
'HH:mm'
),
confirmAttendance
:
item
.
confirmAttendance
,
title
:
item
.
title
,
id
:
item
.
id
id
:
item
.
id
,
isBeOverdue
:
currentDate
.
getTime
()
>
endTime
.
getTime
()
?
true
:
false
};
//模板会议id为空
if
(
type
==
'repeat'
)
{
...
...
@@ -249,31 +250,35 @@ create.Page({
pushItem
.
id
=
''
}
if
(
DateMap
.
has
(
toLocaleDateString
(
startTime
)))
{
DateMap
.
get
(
toLocaleDateString
(
startTime
)).
push
(
pushItem
)
}
// 如果是跨天会议,需要手动在今天以后的其他天 添加会议日程
const
nextDateList
=
getNextDateList
(
startTime
,
endTime
);
if
(
nextDateList
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
nextDateList
.
length
;
i
++
)
{
// 如果是跨天会议,需要手动在起始天以后的其他天 添加会议日程
const
nextDateList
=
getNextDateList
(
startTime
,
endTime
);
//返回日期包括起始天
if
(
nextDateList
.
length
>
1
)
{
pushItem
.
isDaySpan
=
true
;
pushItem
.
isFewDays
=
1
;
pushItem
.
isfirstDayOrEndDay
=
'0'
// 0 第一天,1中间的天,2结束的天
pushItem
.
duration
=
nextDateList
.
length
;
for
(
let
i
=
1
;
i
<
nextDateList
.
length
;
i
++
)
{
if
(
DateMap
.
has
(
nextDateList
[
i
]))
{
DateMap
.
get
(
nextDateList
[
i
]).
push
({
DateMap
.
get
(
nextDateList
[
i
]).
unshift
({
...
pushItem
,
isDaySpan
:
true
,
isfirstDayOrEndDay
:
i
===
0
?
"0"
:
i
===
nextDateList
.
length
?
"2"
:
"1"
,
// 0 第一天,1中间的天,2结束的天
isFewDays
:
i
+
1
,
duration
:
nextDateList
.
length
+
1
,
isBeOverdue
:
currentDate
.
getTime
()
>
endTime
.
getTime
()
?
true
:
false
isfirstDayOrEndDay
:
nextDateList
.
length
-
1
===
i
?
"2"
:
"1"
,
// 0 第一天,1中间的天,2结束的天
});
}
}
}
if
(
DateMap
.
has
(
toLocaleDateString
(
startTime
)))
{
DateMap
.
get
(
toLocaleDateString
(
startTime
)).
push
(
pushItem
)
}
},
// 根据接口返回数据生成填充DateMap
setDateMapByResponse
(
response
)
{
if
(
response
)
{
const
repeatIdList
=
[];
//重复会议的ID
// 处理重复会议 templateList
console
.
log
(
'deal templateList'
)
response
.
templateList
.
forEach
(
item
=>
{
repeatIdList
.
push
(
item
.
id
)
// 生成rrules规则
...
...
@@ -312,21 +317,23 @@ create.Page({
}
});
console
.
log
(
'deal scheduleList'
)
// 处理单次会议 scheduleList
response
.
scheduleList
.
forEach
(
item
=>
{
if
(
!
item
.
scheduleTemplateId
)
{
this
.
setDateMapValue
(
new
Date
(
item
.
startTime
.
replace
(
/-/g
,
'/'
)),
new
Date
(
item
.
endTime
.
replace
(
/-/g
,
'/'
)),
item
);
}
//
if (!item.scheduleTemplateId) {
//
this.setDateMapValue(new Date(item.startTime.replace(/-/g, '/')), new Date(item.endTime.replace(/-/g, '/')), item);
//
}
// 有scheduleTemplateId则是虚拟会议转成实体会议,需要替换rrule生成的模板会议
else
if
(
repeatIdList
.
includes
(
item
.
scheduleTemplateId
))
{
if
(
repeatIdList
.
includes
(
item
.
scheduleTemplateId
))
{
const
list
=
DateMap
.
get
(
toLocaleDateString
(
new
Date
(
item
.
planDate
.
replace
(
/-/g
,
'/'
))))
||
[];
list
.
forEach
((
o
,
index
)
=>
{
if
(
o
.
scheduleTemplateId
==
item
.
scheduleTemplateId
)
{
list
.
splice
(
index
,
1
,
item
)
list
.
splice
(
index
,
1
);
}
});
}
this
.
setDateMapValue
(
new
Date
(
item
.
startTime
.
replace
(
/-/g
,
'/'
)),
new
Date
(
item
.
endTime
.
replace
(
/-/g
,
'/'
)),
item
);
});
}
},
...
...
utils/utils.js
View file @
c3cb55a9
...
...
@@ -30,6 +30,9 @@ export function debounce(fn, delay) {
Symbol 分隔符号
*/
export
function
getFormatDate
(
time
,
format
,
symbol
)
{
if
(
typeof
time
==
'string'
)
{
time
=
new
Date
(
time
.
replace
(
/-/g
,
'/'
))
}
format
=
format
?
format
:
"yyyyMMdd HH:mm:ss"
;
symbol
=
symbol
?
symbol
:
""
;
let
year
=
time
.
getFullYear
();
...
...
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