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
提交
21cf7ddf
提交
21cf7ddf
编写于
11月 16, 2021
作者:
xiaoping.di
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
时间选择
上级
c3613675
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
47 行增加
和
13 行删除
+47
-13
newScheduling.vue
src/views/IM/diagnosis-admin/modal/newScheduling.vue
+47
-13
未找到文件。
src/views/IM/diagnosis-admin/modal/newScheduling.vue
浏览文件 @
21cf7ddf
...
...
@@ -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,8 @@
select
:
this
.
selectInfo
,
selectMinDistance
:
0
,
eventResize
:
this
.
eventResize
,
eventOverlap
:
false
,
// eventDurationEditable:false,
eventDrop
:
this
.
eventDrop
,
editable
:
true
,
overlap
:
false
,
...
...
@@ -404,6 +407,34 @@
}
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
.
startStr
).
format
(
'YYYY-MM-DD HH:mm:ss'
);
...
...
@@ -444,6 +475,10 @@
}
},
eventResize
(
event
)
{
console
.
log
(
event
,
'eventevent'
);
// if(){
// }
const
index
=
this
.
getIdDeleteData
(
event
.
event
.
id
);
const
oldData
=
this
.
calendarOptions
.
events
;
const
keyAll
=
Object
.
keys
(
oldData
[
index
]);
...
...
@@ -459,9 +494,11 @@
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,8 +549,10 @@
},
selectInfo
(
info
)
{
console
.
log
(
info
,
'infoinfoinfo'
);
const
startDay
=
new
Date
(
info
.
start
).
getDay
();
const
endDay
=
new
Date
(
info
.
end
).
getDay
();
// const startDay = new Date(info.start).getDay();
// const endDay = new Date(info.end).getDay();
// const startHour = new Date(info.start).hour();
// const endHour = new Date(info.end).hour();
// const chooseStartH = new Date(info.start).getHours();
// const chooseEndH = new Date(info.end).getHours();
// // const startH = 9;
...
...
@@ -540,9 +579,9 @@
// );
// }
// this.calendarOptions.events = timeList;
if
(
startDay
!=
endDay
)
{
return
this
.
$toast
(
'不能夸天选择排班'
);
}
//
if (startDay != endDay) {
//
return this.$toast('不能夸天选择排班');
//
}
const
id
=
(
this
.
calendarOptions
.
events
.
length
+
1
)
*
10
;
info
.
id
=
id
;
const
keyAll
=
[
'end'
,
'endStr'
,
'id'
,
'start'
,
'startStr'
,
'week'
];
...
...
@@ -554,7 +593,6 @@
dataObj
[
item
]
=
info
[
item
];
}
});
console
.
log
(
dataObj
,
'dataObjdataObj'
);
this
.
calendarOptions
.
events
.
push
(
dataObj
);
},
...
...
@@ -563,7 +601,6 @@
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
;
...
...
@@ -572,12 +609,9 @@
// 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 +667,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
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录