Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-admin-consultation
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-admin-consultation
提交
af50dfbe
提交
af50dfbe
编写于
11月 16, 2021
作者:
xiaoping.di
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/dxp' into 'develop'
Feature/dxp See merge request
!193
上级
c3613675
7e2a9a02
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
96 行增加
和
46 行删除
+96
-46
index.scss
src/views/IM/diagnosis-admin/modal/index.scss
+14
-0
newScheduling.vue
src/views/IM/diagnosis-admin/modal/newScheduling.vue
+82
-46
未找到文件。
src/views/IM/diagnosis-admin/modal/index.scss
浏览文件 @
af50dfbe
...
...
@@ -332,3 +332,17 @@
word-wrap
:
break-word
;
white-space
:
normal
;
}
/
deep
/
.fc-col-header-cell-cushion
{
background
:
#fff
;
border
:
1px
solid
#0d9078
;
color
:
#0d9078
;
border-radius
:
20px
;
height
:
30px
;
line-height
:
25px
;
font-size
:
14px
;
margin
:
10px
0
;
text-decoration
:
none
;
}
/
deep
/
a
:hover
{
text-decoration
:
none
;
}
src/views/IM/diagnosis-admin/modal/newScheduling.vue
浏览文件 @
af50dfbe
...
...
@@ -175,6 +175,7 @@
week
:
1
,
// 1:当前周 2:上一周 3:下一周
currentIndex
:
3
,
haveWeek
:
[
1
],
businessHours
:
true
,
calendarOptions
:
{
// 引入的插件,比如fullcalendar/daygrid,fullcalendar/timegrid引入后才可显示月,周,日
plugins
:
[
dayGridPlugin
,
interactionPlugin
,
timeGridPlugin
],
...
...
@@ -186,6 +187,10 @@
select
:
this
.
selectInfo
,
selectMinDistance
:
0
,
eventResize
:
this
.
eventResize
,
eventOverlap
:
false
,
navLinks
:
true
,
navLinkDayClick
:
this
.
navLinkDayClick
,
// eventDurationEditable:false,
eventDrop
:
this
.
eventDrop
,
editable
:
true
,
overlap
:
false
,
...
...
@@ -322,6 +327,42 @@
}
});
},
navLinkDayClick
(
date
)
{
const
day
=
dayjs
(
date
).
day
();
const
dayDate
=
dayjs
(
date
).
date
();
const
dayFormat
=
dayjs
(
date
).
format
(
'YYYY-MM-DD'
);
let
isAddAllDay
=
true
;
const
data
=
this
.
calendarOptions
.
events
;
const
len
=
data
.
length
;
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
const
itemDay
=
dayjs
(
data
[
i
].
start
).
day
();
if
(
!
data
[
i
].
constraint
&&
day
===
itemDay
)
{
data
[
i
].
allStatus
&&
(
isAddAllDay
=
false
);
const
index
=
this
.
getIdDeleteData
(
data
[
i
].
id
);
this
.
isDoIt
=
true
;
this
.
calendarOptions
.
events
.
splice
(
index
,
1
);
i
--
;
}
}
if
(
isAddAllDay
)
{
// 添加日期
const
list
=
[
{
startTime
:
'09:00:00'
,
endTime
:
'12:00:00'
},
{
startTime
:
'13:00:00'
,
endTime
:
'17:00:00'
},
{
startTime
:
'18:00:00'
,
endTime
:
'21:00:00'
},
];
list
.
forEach
((
item
)
=>
{
const
obj
=
{};
obj
.
id
=
dayDate
+
(
this
.
calendarOptions
.
events
.
length
+
1
)
*
10
;
obj
.
week
=
this
.
week
;
obj
.
end
=
dayFormat
+
' '
+
item
.
endTime
;
obj
.
start
=
dayFormat
+
' '
+
item
.
startTime
;
obj
.
allStatus
=
true
;
console
.
log
(
obj
);
this
.
calendarOptions
.
events
.
push
(
obj
);
});
}
},
getCopyData
(
data
)
{
const
copyList
=
[];
const
addDay
=
7
;
...
...
@@ -404,11 +445,39 @@
}
this
.
calendarOptions
.
events
.
push
(
dataObj
);
});
this
.
limmitDateFun
();
},
limmitDateFun
()
{
const
list
=
[];
for
(
let
i
=
0
;
i
<
7
;
i
++
)
{
const
obj
=
{};
const
lastObj
=
{};
const
day
=
dayjs
(
this
.
getEveryDay
)
.
add
(
i
,
'day'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
);
obj
.
start
=
dayjs
(
day
).
add
(
12
,
'hour'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
obj
.
end
=
dayjs
(
day
).
add
(
13
,
'hour'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
lastObj
.
start
=
dayjs
(
day
)
.
add
(
17
,
'hour'
)
.
format
(
'YYYY-MM-DD HH:mm:ss'
);
lastObj
.
end
=
dayjs
(
day
).
add
(
18
,
'hour'
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
obj
.
constraint
=
'businessHours'
;
obj
.
color
=
'#ccc'
;
obj
.
display
=
'background'
;
obj
.
editable
=
false
;
lastObj
.
constraint
=
'businessHours'
;
lastObj
.
color
=
'#ccc'
;
lastObj
.
display
=
'background'
;
lastObj
.
editable
=
false
;
this
.
calendarOptions
.
events
.
push
(
obj
);
this
.
calendarOptions
.
events
.
push
(
lastObj
);
}
console
.
log
(
list
,
'obj'
,
this
.
getEveryDay
);
},
handleDatesSet
(
dataInfo
)
{
this
.
getEveryDay
=
dayjs
(
dataInfo
.
start
Str
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
this
.
getEveryDay
=
dayjs
(
dataInfo
.
start
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
const
currentTime
=
new
Date
().
getTime
();
// 今天的时间戳
const
getTime
=
new
Date
(
dataInfo
.
start
Str
).
getTime
();
// 每周周一的时间戳
const
getTime
=
new
Date
(
dataInfo
.
start
).
getTime
();
// 每周周一的时间戳
const
cz
=
currentTime
-
getTime
;
// 每周周一时间戳 - 今天的时间
const
oneHour
=
1
*
60
*
60
*
1000
*
24
;
// 一天的时间戳
const
timeDifference
=
(
cz
/
oneHour
)
|
0
;
// 每周一时间距离今天时间数量
...
...
@@ -459,9 +528,10 @@
this
.
getHandleTime
(
dataObj
);
},
handleEventClick
(
event
)
{
if
(
!
this
.
calendarOptions
.
selectable
)
{
if
(
!
this
.
calendarOptions
.
selectable
||
event
.
event
.
constraint
)
{
return
;
}
console
.
log
(
event
,
event
,
'iiiieventeventevent'
);
this
.
$confirm
(
'你要取消日期吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
...
...
@@ -512,38 +582,8 @@
},
selectInfo
(
info
)
{
console
.
log
(
info
,
'infoinfoinfo'
);
const
startDay
=
new
Date
(
info
.
start
).
getDay
();
const
endDay
=
new
Date
(
info
.
end
).
getDay
();
// const chooseStartH = new Date(info.start).getHours();
// const chooseEndH = new Date(info.end).getHours();
// // const startH = 9;
// const middleH = 12;
// // const middleEH = 18;
// const endH = 21;
// const timeList = [];
// const timeObj = {};
// if (chooseStartH
<
middleH
&&
chooseEndH
>=
endH
)
{
// console.log(chooseStartH, chooseEndH, 'endDayendDayendDayendDay1111');
// timeList.push(
// {
// start:'2021-11-25 09:00:00',
// end:'2021-11-25 12:00:00'
// },
// {
// start:'2021-11-25 13:00:00',
// end:'2021-11-25 17:00:00'
// },
// {
// start:'2021-11-25 18:00:00',
// end:'2021-11-25 21:00:00'
// }
// );
// }
// this.calendarOptions.events = timeList;
if
(
startDay
!=
endDay
)
{
return
this
.
$toast
(
'不能夸天选择排班'
);
}
const
id
=
(
this
.
calendarOptions
.
events
.
length
+
1
)
*
10
;
const
day
=
dayjs
(
info
.
start
).
date
();
const
id
=
day
+
(
this
.
calendarOptions
.
events
.
length
+
1
)
*
10
;
info
.
id
=
id
;
const
keyAll
=
[
'end'
,
'endStr'
,
'id'
,
'start'
,
'startStr'
,
'week'
];
const
dataObj
=
{};
...
...
@@ -554,30 +594,26 @@
dataObj
[
item
]
=
info
[
item
];
}
});
console
.
log
(
dataObj
,
'dataObjdataObj'
);
this
.
calendarOptions
.
events
.
push
(
dataObj
);
// this.calendarOptions.events.forEach(item=>{
// if(!item.constraint){
// console.log(item.id);
// }
// });
},
selectAllow
(
info
)
{
this
.
isDoIt
=
true
;
const
startDay
=
new
Date
(
info
.
start
).
getDay
();
const
endDay
=
new
Date
(
info
.
end
).
getDay
();
const
startHour
=
dayjs
(
info
.
start
).
hour
();
const
endHour
=
dayjs
(
info
.
end
).
hour
();
console
.
log
(
dayjs
(
info
.
start
).
format
(
'YYYY-MM-DD HH:mm:ss'
));
if
(
startDay
!=
endDay
)
{
return
false
;
}
// if (dayjs(info.start).format('YYYY-MM-DD HH:mm:ss').split(' ')[1] == '12:00:00' || dayjs(info.start).format('YYYY-MM-DD HH:mm:ss').split(' ')[1] == '17:00:00') {
// return false;
// }
if
(
startHour
<=
12
&&
endHour
<=
21
)
{
return
false
;
}
else
if
(
startHour
>=
12
&&
endHour
<=
21
)
{
if
(
startHour
==
12
||
startHour
==
17
)
{
return
false
;
}
const
currentDate
=
new
Date
();
const
start
=
info
.
start
;
const
end
=
info
.
end
;
...
...
@@ -633,7 +669,7 @@
const
data
=
this
.
calendarOptions
.
events
;
console
.
log
(
'data======='
,
data
);
data
.
forEach
((
item
)
=>
{
if
(
item
.
week
==
(
weekV
?
weekV
:
this
.
week
))
{
if
(
item
.
week
==
(
weekV
?
weekV
:
this
.
week
)
&&
!
item
.
constraint
)
{
const
obj
=
{};
obj
.
startTime
=
this
.
dateFormat
(
'YYYY-mm-dd HH:MM:SS'
,
item
.
start
);
obj
.
endTime
=
this
.
dateFormat
(
'YYYY-mm-dd HH:MM:SS'
,
item
.
end
);
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录