diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/SeatForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/SeatForm.cshtml
index 30e5fb3ce..186f676b6 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/SeatForm.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/SeatForm.cshtml
@@ -13,9 +13,9 @@
考试时间:{{dataOne.EaxmStartTime}}{{dataOne.EaxmEndTime}}
- -
+
-
-
{{item.StuName}}
+
{{item.StuName||'-'}}
{{item.SitNumber}}
@@ -28,6 +28,7 @@
data() {
return {
StuList: [],
+ SeatList: [],
dataOne: {},
StuListColumns: [],
width: '10%',
@@ -50,46 +51,46 @@
cache: false,
success: (res) => {
if (res.code == 200) {
+ let SeatList = []
this.StuList = res.data.StuList || []
- this.dataOne = res.data.dataOne || {}
- if (!this.StuList.length) {
- this.isEmpty = true
- return
+ this.dataOne = res.data.dataOne
+ //多少列
+ let cols = this.dataOne.SeatColumns
+ //多少行
+ let rows = this.dataOne.SeatRows
+ //总座位数
+ let total = cols * rows
+ //初始化座位
+ for (let i = 0; i < total; i++) {
+ let SitNumber = i + 1
+ if (String(SitNumber).length == 1) SitNumber = '00' + String(SitNumber);
+ if (String(SitNumber).length == 2) SitNumber = '0' + String(SitNumber)
+ SeatList.push({
+ SitNumber,
+ StuName: '',
+ StuNo:''
+ })
}
- this.width = 100 / this.dataOne.SeatColumns + '%'
- //1列:[],2:[]
- let data = {}
- //计算出多少行
- let rows = Math.ceil(res.data.StuList.length / this.dataOne.SeatColumns);
- if (rows == 1) return
- //最后一行个数(行全的列数)
- let lastRow = res.data.StuList.length % this.dataOne.SeatColumns
- lastRow = lastRow || this.dataOne.SeatColumns
- //不缺一行的列数据总个数
- let wholeItems = rows * lastRow
- let colCurrent = 1
- this.StuList.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)
+ //列的宽度
+ this.width = 100 / cols + '%'
+ 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++) {
+ let item = SeatList[col][row]
+ let obj = this.StuList.find(e => e.SitNumber == item.SitNumber)
+ this.SeatList.push(obj || item)
}
- })
- let arr = []
- for (let i = 0; i < rows; i++) {
- Object.values(data).forEach(e => {
- if (e[i]) {
- arr.push(e[i])
- }
- })
}
- this.StuList = arr
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js
index ec1fe5379..011360ccb 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js
@@ -179,10 +179,10 @@ var bootstrap = function ($, learun) {
return;
}
var IsEdit = $('#gridtable').jfGridValue('IsEdit');
- if (IsEdit.indexOf('false') != -1) {
- learun.alert.warning("选中记录中包含不可编辑项目!");
- return;
- }
+ //if (IsEdit.indexOf('false') != -1) {
+ // learun.alert.warning("选中记录中包含不可编辑项目!");
+ // return;
+ //}
if (learun.checkrow(keyValue)) {
var AcademicYearNo = $('#gridtable').jfGridValue('AcademicYearNo');
var Semester = $('#gridtable').jfGridValue('Semester');
@@ -192,6 +192,7 @@ var bootstrap = function ($, learun) {
title: '座位',
width: 1200,
height: 800,
+ btn: IsEdit.indexOf('false') != -1 ? [] : ['确认', '关闭'],
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/FormSeat?keyValue=' + keyValue + '&AcademicYearNo=' + AcademicYearNo + '&Semester=' + Semester + '&ClassRoomNo=' + classroomNo,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);