Преглед на файлове

考场管理座位功能

娄底高职分支
yxq преди 1 месец
родител
ревизия
7a026ad91e
променени са 3 файла, в които са добавени 60 реда и са изтрити 49 реда
  1. +48
    -47
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormSeat.cshtml
  2. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js
  3. +5
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailService.cs

+ 48
- 47
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/FormSeat.cshtml Целия файл

@@ -2,7 +2,6 @@
ViewBag.Title = "考场信息-查看";
Layout = "~/Views/Shared/_Index.cshtml";
}
<link href="~/Content/css/UserCenter/user.css" rel="stylesheet" />
<div id="app" style="padding:20px;">
<div class="title" style="font-size:18px;color:#333;lineHeight:50px;textAlign:center;position:relative;">
{{dataOne.tClassroomName}}排考座位表
@@ -13,16 +12,17 @@
<span>考试时间:{{dataOne.EaxmStartTime}}{{dataOne.EaxmEndTime}}</span>
</div>*@
<ul class="SeatList" style="overflow:scroll;height:600px">
<li v-for="item in SeatList" :key="item.SitNumber" :style="{width:width,float:'left',padding:'36px 10px',height:'58px',textAlign:'center'}">
<li v-for="(item,index) in SeatList" :ECEnabled="item.ECEnabled" v-on:click="itemClick(index)" :key="index" :style="{width:width,float:'left',padding:'36px 10px',height:'58px',textAlign:'center',color:item.ECEnabled?'#E6A23C':'#409EFF'}">
<div class="content" style="border:1px solid #ccc;padding:6px;">
<div>{{item.StuName}}</div>
{{item.SitNumber}}
<div>{{item.ECEnabled?'禁用':'正常'}}</div>
{{item.ECOrder}}
</div>
</li>
</ul>
<div style="color:#333;font-size:14px;text-align:center;line-height:80px" v-if="isEmpty">暂无数据</div>
</div>
<script>
var acceptClick;
var vm = new Vue({
el: "#app",
data() {
@@ -37,17 +37,12 @@
created() {
this.getData()
},
mounted() {
acceptClick = this.submit
},
methods: {
getData: function () {
$.ajax({
//保存接口
//传参学年学期,考场编号+名称 +list(ECorder,EcEnbaled)空就是fasle 允许有人就是true
//$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/SaveDetailForm?keyValue=' + keyValue, postData, function (res) {
// // 保存成功后才回调
// if (!!callBack) {
// callBack();
// }
//});
url: '/EducationalAdministration/Exam_ExamRoom/GetClassRoomDetailData',
data: {
ClassRoomNo: request('ClassRoomNo'), AcademicYearNo: request('AcademicYearNo'), Semester: request('Semester')
@@ -57,48 +52,36 @@
async: true,
cache: false,
success: (res) => {
console.log(res,"data")
console.log(res, "data")
if (res.code == 200) {
this.SeatList = res.data.SeatList || []
this.dataOne = res.data.dataOne || {}
if (!this.SeatList.length) {
let SeatList = res.data.Exam_ExamRoomDetailData || []
this.dataOne = res.data.Exam_ExamRoomData || {}
if (!SeatList.length) {
this.isEmpty = true
return
}
//多少列
let cols = this.dataOne.SeatColumns
//多少行
let rows = this.dataOne.SeatRows
//列的宽度
this.width = 100 / this.dataOne.SeatColumns + '%'
//1列:[],2:[]
let data = {}
//计算出多少行
let rows = Math.ceil(res.data.SeatList.length / this.dataOne.SeatColumns);
if (rows == 1) return
//最后一行个数(行全的列数)
let lastRow = res.data.SeatList.length % this.dataOne.SeatColumns
lastRow = lastRow || this.dataOne.SeatColumns
//不缺一行的列数据总个数
let wholeItems = rows * lastRow
let colCurrent = 1
this.SeatList.forEach((e, i) => {
if (i + 1 <= wholeItems) {
colCurrent = Math.ceil((i + 1) / rows)
colCurrent = colCurrent || 1
if (!data[colCurrent]) data[colCurrent] = []
data[colCurrent].push(e)
} else {
let colCurrent_ = Math.ceil((i + 1 - wholeItems) / (rows - 1))
colCurrent_ = colCurrent_ || 1
if (!data[colCurrent_ + colCurrent]) data[colCurrent_ + colCurrent] = []
data[colCurrent_ + colCurrent].push(e)
function arrayToMatrix(arr, size) {
var matrix = [], index = 0;
for (var i = 0; i < arr.length; i += size) {
let pushArr = arr.slice(i, i + size)
if (index % 2 !== 0) pushArr.reverse();
index += 1
matrix.push(pushArr);
}
return matrix;
}
SeatList = arrayToMatrix(SeatList, rows)
for (let row = 0; row < rows; row++) {
for (let col = 0; col < cols; col++) {
this.SeatList.push(SeatList[col][row])
}
})
let arr = []
for (let i = 0; i < rows; i++) {
Object.values(data).forEach(e => {
if (e[i]) {
arr.push(e[i])
}
})
}
this.SeatList = arr
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
@@ -110,6 +93,24 @@
}
})
},
itemClick(index) {
//保存接口
//传参学年学期,考场编号+名称 +list(ECorder,EcEnbaled)空就是fasle 允许有人就是true
this.SeatList[index].ECEnabled = !this.SeatList[index].ECEnabled
},
submit(callBack) {
var postData = {
ClassRoomNo: request('ClassRoomNo'), AcademicYearNo: request('AcademicYearNo'), Semester: Number(request('Semester')),
list: this.SeatList
};
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/SaveDetailForm?keyValue=' + request('keyValue'), postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
}
});
},

printClick() {
$('.btn').css('display', 'none')
$('.SeatList').css('overflow', 'unset')


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js Целия файл

@@ -174,6 +174,10 @@ var bootstrap = function ($, learun) {

$('#lr_seat').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ERId');
if (keyValue.indexOf(',') != -1) {
learun.alert.warning("只能选择一条记录进行编辑!");
return;
}
var IsEdit = $('#gridtable').jfGridValue('IsEdit');
if (IsEdit.indexOf('false') != -1) {
learun.alert.warning("选中记录中包含不可编辑项目!");
@@ -189,6 +193,9 @@ var bootstrap = function ($, learun) {
width: 1200,
height: 800,
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/FormSeat?keyValue=' + keyValue + '&AcademicYearNo=' + AcademicYearNo + '&Semester=' + Semester + '&ClassRoomNo=' + classroomNo,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});


+ 5
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailService.cs Целия файл

@@ -236,7 +236,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
try
{
var del = db.FindList<Exam_ExamRoomDetailEntity>(x => x.ClassRoomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester);
db.Delete(del);
foreach (var item in del)
{
db.Delete(item);
}
List<Exam_ExamRoomDetailEntity> enList = new List<Exam_ExamRoomDetailEntity>();
if (entity.Count() > 0)
{
@@ -255,7 +258,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
db.Insert(enList);
//修改实际考试人数
var Update = db.FindEntity<Exam_ExamRoomEntity>(x => x.ClassroomNo == ClassroomNo && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester);
Update.ActualNum = enList.Where(x => x.ECEnabled == true).Count();
Update.ActualNum = Update.Where(x => x.ECEnabled == true).Count();
db.Update(Update);
db.Commit();
}


Зареждане…
Отказ
Запис