Bläddra i källkod

场次安排表查看功能

娄底高职分支
yxq 1 månad sedan
förälder
incheckning
7729f84688
2 ändrade filer med 44 tillägg och 42 borttagningar
  1. +39
    -38
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/SeatForm.cshtml
  2. +5
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js

+ 39
- 38
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ArrangeExamTermNew/SeatForm.cshtml Visa fil

@@ -13,9 +13,9 @@
<span>考试时间:{{dataOne.EaxmStartTime}}{{dataOne.EaxmEndTime}}</span>
</div>
<ul class="StuList" style="overflow:scroll;height:600px">
<li v-for="item in StuList" :key="item.SitNumber" :style="{width:width,float:'left',padding:'36px 10px',height:'58px',textAlign:'center'}">
<li v-for="item in SeatList" :key="item.SitNumber" :style="{width:width,float:'left',padding:'36px 10px',height:'58px',textAlign:'center'}">
<div class="content" style="border:1px solid #ccc;padding:6px;">
<div>{{item.StuName}}</div>
<div>{{item.StuName||'-'}}</div>
{{item.SitNumber}}
</div>
</li>
@@ -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) {


+ 5
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.js Visa fil

@@ -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);


Laddar…
Avbryt
Spara