瀏覽代碼

校历查看

金隅分支
zhangli 3 年之前
父節點
當前提交
0c3887c608
共有 1 個檔案被更改,包括 52 行新增44 行删除
  1. +52
    -44
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/ScheduleIndex.cshtml

+ 52
- 44
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SchoolCalendar/ScheduleIndex.cshtml 查看文件

@@ -14,6 +14,9 @@
)

<script type='text/javascript'>
var search = (window.location.search).split('?')[1];
var type = search.split('=')[1];
//type=1 校历查看;type=2 校历管理(日历模式)
$(document).ready(function () {
resize();
$('.calendar').fullCalendar({
@@ -41,12 +44,9 @@
axisFormat: "HH:00",
height: $(window).height() - 55,
dayClick: function (date, allDay, jsEvent, view) {
var _date = $.fullCalendar.formatDate(date, 'yyyy-MM-dd');
var _time = $.fullCalendar.formatDate(date, 'HHmm');
btn_add(_date, _time);
@*if (top.learun.formatDate(_date, 'yyyyMMdd') >= ('@Learun.Util.Time.GetToday("yyyyMMdd")')) {
btn_add(_date, _time);
}*@
if (type == 2) {
btn_add();
}
},
editable: true,
eventLimit: true,
@@ -60,11 +60,12 @@
evtcontent += '<span class="fc-event-time">' + event.academicYearNo + '</span>';
evtcontent += '<span class="fc-event-title">: ' + event.title + '</span>';
evtcontent += '</div><div class="ui-resizable-handle ui-resizable-e">&nbsp;&nbsp;&nbsp;</div>';
evtcontent += '<div class="fc-event-delete" style="width:100%;height:100%;background-color:#000;" data-id="' + event.id +'">删除</div>';

if (type == 2) {
evtcontent += '<div class="fc-event-delete" style="width:100%;height:100%;background-color:#000;" data-id="' + event.id + '">删除</div>';
}
element.html(evtcontent);
} else {
var evtcontent = '<div class="fc-event-inner fc-event-skin" data-id="' + event.id +'" style="height:98%">';
var evtcontent = '<div class="fc-event-inner fc-event-skin" data-id="' + event.id + '" style="height:98%">';
evtcontent += '<div class="fc-event-head fc-event-skin">';
evtcontent += '<span class="fc-event-time">' + event.academicYearNo + '</span>';
//evtcontent += '<div class="fc-event-time">' + fstart + " - " + fend + event.title + '</div>';
@@ -73,7 +74,9 @@
evtcontent += '<div class="fc-event-content"></div>';
evtcontent += '<div class="fc-event-bg"></div>';
evtcontent += '</div>';
evtcontent += '<div class="fc-event-delete" style="width:100%;height:2%;background-color:#000;" data-id="' + event.id +'">删除</div>';
if (type == 2) {
evtcontent += '<div class="fc-event-delete" style="width:100%;height:2%;background-color:#000;" data-id="' + event.id + '">删除</div>';
}
element.html(evtcontent);
}
},
@@ -102,47 +105,52 @@
});
}
//添加校历
function btn_add(date, time) {
top.learun.layerForm({
id: 'form',
title: '添加校历',
url: '/EducationalAdministration/SchoolCalendar/Form',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
function btn_add() {
if (type == 2) {
top.learun.layerForm({
id: 'form',
title: '添加校历',
url: '/EducationalAdministration/SchoolCalendar/Form',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
}
};
//编辑校历
$(document).on('click', '.fc-event-inner', function () {
var keyValue = $(this).attr('data-id');
top.learun.layerForm({
id: 'form',
title: '编辑校历',
url: '/EducationalAdministration/SchoolCalendar/Form?keyValue='+keyValue,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
if (type == 2) {
var keyValue = $(this).attr('data-id');
top.learun.layerForm({
id: 'form',
title: '编辑校历',
url: '/EducationalAdministration/SchoolCalendar/Form?keyValue=' + keyValue,
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
}
});
//删除日程
$(document).on('click', '.fc-event-delete', function () {
var keyValue = $(this).attr('data-id');
if (!keyValue) {
learun.alert.warning("请选择日程!");
return false;
}
top.learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
top.learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SchoolCalendar/DeleteForm', { keyValue: keyValue }, function () {
callback();
});
if (type == 2) {
var keyValue = $(this).attr('data-id');
if (!keyValue) {
learun.alert.warning("请选择日程!");
return false;
}
});

top.learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
top.learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SchoolCalendar/DeleteForm', { keyValue: keyValue }, function () {
callback();
});
}
});
}
});

function callback() {


Loading…
取消
儲存